I have to prove that the congruence $2x^2 +1 ≡ 0\pmod p$ has a solution if and only if $p ≡ 1 \text{ or } 3\pmod 8$, for any odd prime.
Thanks.
I have to prove that the congruence $2x^2 +1 ≡ 0\pmod p$ has a solution if and only if $p ≡ 1 \text{ or } 3\pmod 8$, for any odd prime.
Thanks.
You want $-2$ to be a square modulo $p$. In fact a solution $x$ exists if and only if $ x^{2} \equiv (-2)/4$ is a square modulo $p$, and thus if and only if $-2$ is a square modulo $p$.
This is because the following congruences modulo $p$ are equivalent: (reworked avoiding inverses at a suggestion of Math Gems in the comments)
Now $$ \left(\frac{-2}{p}\right) = \left(\frac{-1}{p}\right) \left(\frac{2}{p}\right) $$ is $1$ if and only if $p \equiv 1, 3 \pmod{8}$.