$\left(\frac{3}{p} \right)=1$ iff $p\equiv 1\pmod{12}$ or $p\equiv -1\pmod{12}$ Let $p\geq 5$ be a prime.

$\left(\frac{3}{p} \right)=1$ iff $p\equiv 1\pmod{12}$ or $p\equiv -1\pmod{12}$.

So $\left(\frac{3}{p} \right)=\left(\frac{p}{3} \right)\cdot (-1)^{(p-1)/2}$ and this is $\left(\frac{p}{3} \right)$ when $p\equiv 1\pmod4$ and it is $-\left(\frac{p}{3} \right)$ if $p\equiv 3\pmod 4$.


*

*Case where $p\equiv 1\pmod 4$: Here $\left(\frac{p}{3} \right)=1$ and therefore $p$ is a square in $\Bbb Z/3\Bbb Z$. This implies $p\equiv 1\pmod 3$, right? I am not sure here. Then the Chinese Remainer Theorem implies that $p\equiv 1\pmod{12}$

*Case where $p\equiv 3\pmod 4$: Here $\left(\frac{p}{3} \right)=-1$, so $p$ is not a square in $\Bbb Z/3\Bbb Z$. Does this imply $p\equiv 2\pmod 3$? We would get $p\equiv 6\mod{12}$ which is not what we want....where did I go wrong?


In my answer to this question there is an elementary proof that
$$\left(\frac{-3}{p}\right)=1\quad\Longleftrightarrow\quad p\equiv 1\pmod{3}\tag{1}$$
Moreover, it is quite well-known and not difficult to prove that
$$\left(\frac{-1}{p}\right)=1\quad\Longleftrightarrow\quad p\equiv 1\pmod{4}\tag{2}$$
hence the claim follows from the multiplicativity of the Legendre symbol and the Chinese remainder theorem: $\left(\frac{3}{p}\right)=1$ iff both $\left(\frac{-3}{p}\right)$ and $\left(\frac{-1}{p}\right)$ equal $+1$ or both equal $-1$.
