Prime One Less Than Square
It can be seen that $2^2 - 1 = 3$ is prime.
Find the next example of a prime which is one less than a perfect square.
We begin by noting that $n^2 - 1 = (n - 1)(n + 1)$.
As $n^2 - 1$ is the product of $n - 1$ and $n + 1$, it can only be prime when $n - 1 = 1 \implies n = 2$. That is, 3 is the only example of a prime being one less than a perfect square.
When is $n^2 + 1$ prime?