What I have done: (not sure if it's right)
$a^2 + 1\equiv 1\pmod 4$ or $2\pmod 4$
But if it has two prime factors in the form $4k + 3$, it will be $1\pmod4$, and I don't know where to go from here
What I have done: (not sure if it's right)
$a^2 + 1\equiv 1\pmod 4$ or $2\pmod 4$
But if it has two prime factors in the form $4k + 3$, it will be $1\pmod4$, and I don't know where to go from here
If you can use Lagrange's theorem of group theory, this is easy:
If you want to avoid Lagrange's theorem, argue as follows:
If $$a^2\equiv -1 \pmod{p}$$ then $-1$ is a quadratic residue modulo $p$. Thus $$\left( \frac{-1}{p}\right)=1$$
Use the Formula for the Legendre symbol $\left( \frac{-1}{p}\right)$.