# Thread: [SOLVED] Wilson theorem Question Explanation

1. ## [SOLVED] Wilson theorem Question Explanation

Use:
$2\cdot4\cdot...\cdot(p-1)\equiv(2-p)(4-p)\cdot...\cdot(p-1-p)\equiv(-1)^{\frac{(p-1)}{2}}\cdot1\cdot3\cdot...\cdot(p-2)$ mod $p$
and
$(p-1)!\equiv-1$ mod p [Wilson's Theorem]
to prove
$1^2\cdot3^2\cdot5^2\cdot...\cdot(p-2)^2\equiv(-1)^{\frac{(p-1)}{2}}$ mod $p$

Relevant equations

Gauss lemma
wilson's theorem [ $(p-1)!\equiv-1$ mod $p$]

The attempt at a solution
need assistance

Thanks

2. $2 \cdot 4 \cdot \cdots \cdot (p-1)$

...... $\equiv (2 - p)(4 - p) \cdots ((p-1)-p) \ (\text{mod }p)$ (simply subtracting the modulus to each term)

...... $\equiv (-1)(p-2) \cdot (-1)(p-4) \cdot (-1)(p -6) \cdots \cdot (-1)(1) \ (\text{mod } p)$ (Factor out $-1$ from each term)

Now, notice that all the numbers from 1 to (p-1) are all least residues of p. We have half the numbers since all the even numbers from 1 to (p-1) are gone, leaving us with $\frac{p-2}{2}$ odd terms (1, 3, 7, ... , p-2 ) and thus $\frac{p-2}{2}$ factors of $-1$. So:

...... $\equiv (-1)^{(p-1)/2} \cdot 1 \cdot 3 \cdot \cdots \cdot (p-2) \ (\text{mod } p)$

3. Thanks a lot

4. Originally Posted by mathsss2
and
$(p-1)!\equiv-1$ mod p [Wilson's Theorem]
to prove
$1^2\cdot3^2\cdot5^2\cdot...\cdot(p-2)^2\equiv(-1)^{\frac{(p-1)}{2}}$ mod $p$
Using what o_O we can finish this problem.

Note $(p-1)! = \left\{ 1\cdot 3 \cdot ... \cdot (p-2) \right\} \left\{ 2\cdot 4\cdot ... \cdot (p-2) \right\} \equiv (-1)^{(p-1)/2} 1^2\cdot 3^2 \cdot ... \cdot (p-2)^2 (\bmod p)$

Thus, $(-1)^{(p-1)/2} 1^2\cdot 3^2 \cdot ... \cdot (p-2)^2 \equiv - 1 \implies 1^2\cdot 3^2 \cdot ... \cdot (p-2)^2 \equiv (-1)^{(p+1)/2} (\bmod p)$

5. Thanks for the help! This problem is now solved. Thanks a lot.