# When is $-3$ a quadratic residue mod $p$?

Going over a past exam in my elementary number theory course, I noticed this question that caught my attention. The question asked for the conditions that allowed $$-3$$ to be a quadratic residue mod $$p$$. Doing some experimentation, I found that this was possible when $$p \equiv 1 \pmod 3$$. So I guess I have answered part of the question. But the proof is obviously nagging me:

Prove $$-3$$ is a quadratic residue in $$\Bbb Z_p$$ if and only if $$p \equiv 1\pmod 3$$.

I've done a bit of work on this, but haven't been able to come up with anything close to elegant nor conclusive. Any help would be appreciated.

• Just to nitpick, $-3$ is a quadratic residue mod $2$ and $3$, as well. So for the iff to be true, you should probably assume $p \geq 5$. – Viktor Vaughn Aug 1 '20 at 3:32
• -3 mod 7 = 2^2 mod 7? – Charlie Chang Aug 1 '20 at 4:12

Here’s an argument that doesn’t depend on Quadratic Reciprocity.

First, for $$-3$$ to be a quadratic residue modulo $$p$$, that’s the same as having a $$\sqrt{-3}$$ in the field $$\Bbb F_p$$ with $$p$$ elements, i.e. $$\Bbb Z/(p)$$.

Second, $$\sqrt{-3}\in\Bbb F_p$$ if and only if $$\Bbb F_p$$ has all three cube roots of unity, since the nontrivial ones are $$\frac{-1\pm\sqrt{-3}}2$$.

Third, $$\Bbb F_p$$ has all three cube roots of unity if and only if $$3$$ divides $$|\Bbb F_p^\times|=p-1$$.

And finally, $$3\mid(p-1)$$ if and only if $$p\equiv1\pmod3$$.

By quadratic reciprocity law we have $$\left(\frac{-3}{p}\right)=\left(\frac{-1}{p}\right)\left(\frac{3}{p}\right)\\=(-1)^{\frac{p-1}{2}}(-1)^{\frac{p-1}{2}\frac{3-1}{2}}\left(\frac{p}{3}\right)\\=\left(\frac{p}{3}\right)$$

Therefore $$\left(\frac{-3}{p}\right)=1\iff \left(\frac{p}{3}\right)=1\iff p\equiv1\pmod{3}$$

• @JyrkiLahtonen That's not really a hint. I'm very sorry for this. I am changing it. – Shubhrajit Bhattacharya Aug 1 '20 at 5:17
• Well I suppose OP still has to prove the reverse direction and deduce that $(\frac{p}{3})$implies that $p$ is 1 mod 3. – NotSoTrivial Aug 1 '20 at 5:19
• NVM, you edited it so that it is the full solution now – NotSoTrivial Aug 1 '20 at 5:20
• My same nitpick as above: your last $\iff$ isn't really true, since $p$ could be $0$ mod $3$, i.e., $p = 3$. – Viktor Vaughn Aug 6 '20 at 7:19
• @RichardD.James I avoided the case $p=3$. See the definition of Legendre Symbol. $\left(\frac{a}{p}\right)$ is defined to equal $0$ when $a\equiv0\pmod{p}$. See the definition here en.m.wikipedia.org/wiki/Legendre_symbol – Shubhrajit Bhattacharya Aug 6 '20 at 7:55