Odd-residue squared product modulo a prime (source code)

= Odd-residue squared product modulo a prime
{title2=$\prod_{j=1}^{(p-3)/2}(2j+1)^2\equiv(-1)^{(p+1)/2}\pmod p$}

For an odd prime $p$, the even residues are the negatives of the odd residues. If $O=1\cdot3\cdots(p-2)$, then $(p-1)!\equiv(-1)^{(p-1)/2}O^2$. Apply <Wilson theorem> to obtain the displayed congruence. The empty product for $p=3$ is one.