On the product $\prod_{1\leq a<b\leq \frac{p-1}{2}}\,\left(a^2+b^2\right)$, where $p$ is prime

elementary-number-theoryfinite-fieldsnumber theoryprime numbersreference-request

Let $p$ be an odd prime natural number. Define
$$M(p):=\prod_{1\leq a<b\leq \frac{p-1}{2}}\,\left(a^2+b^2\right)\,.$$
Prove that, over the field $\mathbb{F}_p=\mathbb{Z}/p\mathbb{Z}$ (i.e., in modulo $p$),
$$M(p)= \left\{
\begin{array}{ll}
0&\text{if }p\equiv1\pmod{4}\,,\\
+1&\text{if }p\equiv3\pmod{16}\text{ or }p\equiv15\pmod{16}\,,\\
-1&\text{if }p\equiv7\pmod{16}\text{ or }p\equiv11\pmod{16}\,.
\end{array}
\right.$$
The first equality (i.e., that $M(p)=0$ for $p\equiv 1\pmod{4}$) is trivial. For now (see this thread), we know that $M(p)=\pm1$ for $p\equiv 3\pmod{4}$. Under my answer in that thread, jpvee found that the claim above holds for prime natural numbers $p$ such that $p\leq 1000$. Does anybody know whether the claim is true, and if it so, how to prove the claim?

Best Answer