= Second supplementary law for quadratic reciprocity
= Quadratic character of two
{synonym}
For every <odd prime> $p$, the <Legendre symbol> of $2$ is
$$
\left(\frac2p\right)=(-1)^{(p^2-1)/8}.
$$
Thus $2$ is a <quadratic residue> for $p\equiv1,7\pmod8$ and a <quadratic nonresidue> for $p\equiv3,5\pmod8$.
Apply <Gauss's lemma (number theory)> to the representatives $2,4,\ldots,p-1$. With $m=(p-1)/2$, exactly
$$
N=m-\left\lfloor\frac p4\right\rfloor
$$
exceed $p/2$. For the four possible odd residues of $p$ modulo $8$, this count has the same <parity> as $(p^2-1)/8$. The lemma gives the formula. For example, at $p=7$ the representatives $2,4,6$ have two entries above $7/2$, giving $(2/7)=1$; indeed $3^2\equiv2\pmod7$.
Back to article page