# Elementary proof of when -2 is a quadratic residue modulo an odd prime?

Mathworld says that $-2$ is a quadratic residue modulo a prime $p$ if and only if $p=8n+1$ or $p=8n+3$, though I don't understand their explanation.

I have seen elementary proofs that $-1$ is a quadratic residue if and only if $p=8n+1$, and $2$ is a quadratic residue if and only if $p = 8n+1$ or $p=8n-1$, but I cannot find (or come up with) a proof for 2. Is there some way to combine the results of $-1$ and $2$, or is there a completely separate way?

Much appreciation, thanks.

-
Incidentally: $-1$ is a quad. residue mod $p$ if $p = 4n+1$ (not just $8n+1$). – Matt E Nov 23 '11 at 16:32

Comment: One way to identify the primes for which $2$ is a quadratic residue is to use Euler's Criterion. The Euler Criterion can also be used to deal directly with $-2$.