## KingGeorge 4 years ago [SOLVED] Before I go to bed, have an interesting little number theory problem because I'm bored. Suppose $$p$$ is an odd prime. Show that $\large\left(\left(\frac{p-1}{2}\right)!\right)^2\equiv(-1)^{\frac{p+1}{2}}\pmod{p}$ (The whole factorial is squared)

1. anonymous

First note that:$\left(\left(\frac{p-1}{2}\right)!\right)^2 = \left(1\cdot2\cdot 3\cdots \frac{p-1}{2}\right)\left(1\cdot2\cdot 3\cdots \frac{p-1}{2}\right)$Since we are looking at things mod p, we see that:$1 = -(p-1),2 = -(p-2),\ldots , \frac{p-1}{2}=-\left(\frac{p-1}{2}+1\right)$This gives us:$\left(1\cdot2\cdot 3\cdots \frac{p-1}{2}\right)\left(1\cdot2\cdot 3\cdots \frac{p-1}{2}\right)$$=\left(1\cdot2\cdot 3\cdots \frac{p-1}{2}\right)\left(-\left(\frac{p-1}{2}+1\right)\cdots -(p-1)\right)$$=(-1)^{\frac{p-1}{2}}(p-1)!$After this, an application of Wilson's Theorem will do the trick.

2. KingGeorge

Perfect solution.