Show that 7 is a quadratic residue for any prime p of the form 28k + 1 and 28k + 3.

Hint: If $p=28k+1$ then $\frac{7-1}{2}\cdot \frac{p-1}{2}$ is even. If $p=28k+3$ then $\frac{7-1}{2}\cdot\frac{p-1}{2}$ is odd.


Using Quadratic Reciprocity Theorem,

$$\left(\frac p7\right)\left(\frac 7p\right)=(-1)^{\frac{3(p-1)}2}$$

Now, if $p\equiv1\pmod4,\left(\frac p7\right)\left(\frac 7p\right)=1\iff \left(\frac 7p\right)=\left(\frac p7\right)$

Now, $(\pm1)^2\equiv1\pmod 7,(\pm2)^2\equiv4,(\pm3)^2\equiv2\implies p$ needs to be $1,2,4\pmod 7$

$p\equiv1\pmod4$ and $p\equiv1\pmod7\implies p\equiv1\pmod {4\cdot7}$

Using CRT, we can show

$p\equiv1\pmod4$ and $p\equiv2\pmod7\implies p\equiv9\pmod {4\cdot7}$

$p\equiv1\pmod4$ and $p\equiv4\pmod7\implies p\equiv25\pmod {4\cdot7}\equiv-3$

Now, if $p\equiv-1\pmod4,\left(\frac p7\right)\left(\frac 7p\right)=-1\iff \left(\frac 7p\right)=-\left(\frac p7\right)$

and $p$ needs to be $3,5,6\pmod 7$

$p\equiv-1\pmod4\equiv3$ and $p\equiv3\pmod7\implies p\equiv3\pmod {4\cdot7}$

$p\equiv-1\pmod4$ and $p\equiv6\pmod7\equiv-1\implies p\equiv-1\pmod {4\cdot7}$

Using CRT, we can show

$p\equiv-1\pmod4$ and $p\equiv5\pmod7\implies p\equiv19\pmod {4\cdot7}\equiv-9$

So, $7$ is a quadratic residue for any prime $p\equiv\pm1,\pm3,\pm9\pmod{28}$