Index-two square-class argument for three related residues (source code)

= Index-two square-class argument for three related residues

For odd $p$, the nonzero squares form an index-two subgroup of $\mathbb F_p^\times$. Given nonzero $a,b$, either $a$ or $b$ is a square, or both occupy the nontrivial coset and $ab$ is a square. Taking $a=2$ and $b=3$ shows that one of $2,3,6$ is a square, apart from the immediate zero case $p=3$.