# Thread: [SOLVED] Wilson theorem Question Explanation

1. ## [SOLVED] Wilson theorem Question Explanation

Use:
$\displaystyle 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 $\displaystyle p$
and
$\displaystyle (p-1)!\equiv-1$ mod p [Wilson's Theorem]
to prove
$\displaystyle 1^2\cdot3^2\cdot5^2\cdot...\cdot(p-2)^2\equiv(-1)^{\frac{(p-1)}{2}}$ mod $\displaystyle p$

Relevant equations

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

The attempt at a solution
need assistance

Thanks

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

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

......$\displaystyle \equiv (-1)(p-2) \cdot (-1)(p-4) \cdot (-1)(p -6) \cdots \cdot (-1)(1) \ (\text{mod } p)$ (Factor out $\displaystyle -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 $\displaystyle \frac{p-2}{2}$ odd terms (1, 3, 7, ... , p-2 ) and thus $\displaystyle \frac{p-2}{2}$ factors of $\displaystyle -1$. So:

......$\displaystyle \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
$\displaystyle (p-1)!\equiv-1$ mod p [Wilson's Theorem]
to prove
$\displaystyle 1^2\cdot3^2\cdot5^2\cdot...\cdot(p-2)^2\equiv(-1)^{\frac{(p-1)}{2}}$ mod $\displaystyle p$
Using what o_O we can finish this problem.

Note $\displaystyle (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, $\displaystyle (-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.