# Elementary Number Theory: Wilson's Theorem

1. Feb 25, 2010

### cwatki14

I am aiming to prove that p is the smallest prime that divides (p-1)!+1. I got the first part of the proof. It pretty much follows from Fermat's Little Theorem/ Wilson's Theorem, but I am stuck on how to prove that p is the smallest prime that divides (p-1)! +1. I am assuming that every other prime divisor of (p-1)!+1 is related to p by some congruence? Any ideas how to prove this tidbit? - Thanks

2. Feb 25, 2010

### JSuarez

Let q < p be a prime. Now what can you say about the congruence $\left(p-1\right)!\equiv -1\left(\rm{mod} q\right)$?

3. Feb 25, 2010

### cwatki14

If q< p then q does q no longer divides (p-1)!+1? If a prime is larger than p then does it also not divide (p-1)!+1?

4. Feb 25, 2010

### JSuarez

You have proved that p is a divisor of (p-1)!+1. Now you want to prove that it is the smallest prime divisor of that quantity, so let's stick with a prime q < p. What does the congruence that I wrote in the first post reduces to?

5. Feb 25, 2010

### cwatki14

so when you pair each term with an inverse everything equals out to one 1x1x(p-1) but when q<p all of these pairs of inverses don't cancel? are there still terms on one of the sides of the congruence?

6. Feb 25, 2010

### JSuarez

If q < p, is q a factor of (p-1)!? If yes, what happens when you reduce mod q?