First supplementary law for quadratic reciprocity (source code)

= First supplementary law for quadratic reciprocity

For an odd <prime> $p$, the <Legendre symbol> satisfies
$$
\left(\frac{-1}{p}\right)=(-1)^{(p-1)/2}.
$$
Consequently, $-1$ is a <quadratic residue> modulo $p$ exactly when $p\equiv1\pmod4$.

By <Euler's criterion>, the <Legendre symbol> is congruent modulo $p$ to $(-1)^{(p-1)/2}$. Both sides are either $1$ or $-1$, and these are distinct modulo an odd <prime>, so the congruence gives equality. Finally, $(p-1)/2$ is <even> precisely for $p\equiv1\pmod4$. For example, $2^2\equiv-1\pmod5$, whereas no square is $-1$ modulo $3$.