Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
Incidentally: $-1$ is a quad. residue mod $p$ if $p = 4n+1$ (not just $8n+1$). – Matt E Nov 23 '11 at 16:32
up vote 6 down vote accepted

Yes, the results can be combined, and you can do it yourself. Just use the general fact that (i) the product of two residues, or two non-residues, is a residue, and (ii) the product of a residue and a non-residue, is a non-residue.

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$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.