# Let $p$ be and odd prime. Use Wilson's Theorem to show that…

Let $p$ be and odd prime. Use Wilson's Theorem to show that:

$[(\frac{p -1}{2}) !]^2$ $\equiv$ $(-1)^{(p+1)/2}$ mod $p$

• My understanding is that this should be as simple as picking an odd prime and simplifying, thus far I have:

$[(\frac{7 - 1}{2}) !]^2$ $\equiv$ $(-1)^{(7+1)/2}$ mod $7$

$[(3) !]^2$ $\equiv$ $(-1)^{4}$ mod $7$

$^2$ $\equiv$ $(-1)^{4}$ mod $7$

$36$ $\equiv$ $1$ mod $7$

Is this the correct approach and if so what would be the following steps (if any), a bit confused as to how i am supposed to "show" this. Any help is greatly appreciated.

• You need to prove it for general $p$, not just a few special cases. – M10687 Apr 13 '16 at 3:08
• Via induction I would assume? – Nick Powers Apr 13 '16 at 3:09
• @NickPowers No, not by induction. (BTW, Wilson's theorem isn't proved by induction either. Have you studied the proof?) – Erick Wong Apr 13 '16 at 3:46

Wilson's theorem gives $(p-1)!\equiv -1\pmod{p}$, but: $$(p-1)! = 1\cdot 2\cdot\ldots\frac{p-1}{2}\cdot\frac{p+1}{2}\cdot\ldots\cdot(p-2)\cdot(p-1)$$ that $\pmod{p}$ is the same as: $$\left(\frac{p-1}{2}\right)!\cdot \left(-\frac{p-1}{2}\right)\cdot\ldots\cdot(-1) = (-1)^{\frac{p-1}{2}}\left(\frac{p-1}{2}\right)!^2.$$ It follows that: $$\left(\frac{p-1}{2}\right)!^2\equiv (-1)^{\frac{p+1}{2}}\pmod{p}.$$