What are the solutions to $p^3-p+1=a^2$ where $p$ is prime and $a$ is natural? I found the solutions:
$p=3$ and $a=5$
$p=5$ and $a=11$
and one solution when $p$ is not a prime:
$p=56$ and $a=419$, i think
I don't know what to do else. I tried to find limits for $a$ or limits for $p$, I tried to do something with factoring but I got nothing. Please help.
If the equation is true, than $a^2 \equiv 1 \pmod p$. This implies that $a \equiv 1$ or $-1 \pmod p$, since $p$ is prime.
If $a \equiv 1 \pmod p$, then $a=pk+1$. This implies that $p^2-pk^2-(2k+1)=0$. This implies that $2k+1$ is divisible by $p$. $k=\frac{pb-1}{2}$ for some natural number $b$. Putting this into our equation, notice that $(\frac{pb-1}{2})^2+b=p$ This implies that $(pb-1)^2+4b=4p$. However, since $b \ge 1$,we can say that $(pb-1)^2+4b \ge (p-1)^2+4 > 4p$ if $p \ge 7$. This implies that $p=5,2,3$. However, since $2k+1$ is divisible by $p$, $p$ is not $2$. Manual computation gives us that $p=5$
In the same way, it $a \equiv -1 \pmod p$, $p$ is 3.
Therefore, $p$ is $3$ or $5$.