Gauss lemma (number theory) (source code)

= Gauss lemma
{disambiguate=number theory}
{c}
{wiki=Gauss's_lemma_(number_theory)}

For an odd prime $p$ and $p\nmid a$, let $m$ be the number of least positive residues among
$$
a,2a,\ldots,\frac{p-1}{2}a
$$
that exceed $p/2$. Then
$$
\left(\frac ap\right)=(-1)^m.
$$