# Math Help - calculate this by wilson's Theorem

1. ## calculate this by wilson's Theorem

express 1^2 * 3^2 * 5^2 * .... * (p-2)^2 (mod p) as a power of -1 .

suppose p is an odd prime.

2. Note that:
$1\equiv{-(p-1)}(\bmod.p)$; $3\equiv{-(p-3)}(\bmod.p)$;... $p-4\equiv{-4}(\bmod.p)$; $p-2\equiv{-2}(\bmod.p)$

Thus: $(p-1)!\equiv{(-1)^{\left(\frac{p-1}{2}\right)}\cdot{1^2\cdot{3^2}\cdot{...\cdot{(p-2)^2}}}}(\bmod.p)$

But $(p-1)!\equiv{-1}(\bmod.p)$ by Wilson's Theorem

Thus: $1^2\cdot{3^2}\cdot{...\cdot{(p-2)^2}}\equiv{(-1)^{1-\left(\frac{p-1}{2}\right)}}(\bmod.p)$