# Thread: Applying Fermat and Wilson's Theorem

1. ## Applying Fermat and Wilson's Theorem

Hi everyone! I just had a couple questions about a few things I read in a textbook.

There were a couple points made that did not show any proof. I was able to prove some of them but the two listed below gave me some trouble. I like to see why things are so and need the proof in order to accept its validity. I was wondering if anyone here could help me prove these?

--- If b > 1 is not prime, then (b-1)! is not congruent to -1 (mod b)
--- If p is an odd prime, then (p-3)! ≡ (p-1)/2 (mod p)

Thank You!

2. #1: If you know Wilson's theorem, then what is the contrapositive of its statement?

#2: By Wilson's theorem, $\displaystyle (p-1)! \equiv - 1 \ (\text{mod } p)$

But: $\displaystyle (p-1)! = (p-1)(p-2)(p-3)!$

Can you finish off?

3. Originally Posted by o_O
#1: If you know Wilson's theorem, then what is the contrapositive of its statement?
#1 is not the contrapositive of Wilson's theorem!

Suppose $\displaystyle p|b$, $\displaystyle p \neq b$. Then $\displaystyle p|(b-1)!$. If $\displaystyle (b-1)!+1\equiv 0 \mod b$ then $\displaystyle (b-1)!+1 = kb$ for some $\displaystyle k \in \mathbb{Z}$. Now $\displaystyle p|b, p|(b-1)!$ but $\displaystyle p \nmid 1$, which is impossible.

4. Hmm .. you sure? Wilson's theorem is a biconditional statement. So if we take the direction that: $\displaystyle (b-1)! \equiv -1 \ (\text{mod b}) \ \Rightarrow \ b \text{ is prime.}$

Then this is logically equivalent to saying if b is not prime, then etc. etc.

5. Oh, in that case you are correct! In my mind Wilson's theorem was "If $\displaystyle p$ is prime, then $\displaystyle (p-1)! \equiv -1 \mod p$", but it makes sense to include the other direction as well.