# Prove that p is the smallest prime that divides (p-1)!+1

By Wilson's Theorem, we know that p divides (p-1)!+1.

Assume there exists another prime d divides (p-1)!+1 and $d<p$.

Then $(p-1)!\equiv-1\mod(d)$.

I am not sure if I am right in the following statement:

Thus, d is not a factor of (p-1)!, which means d is not any of the {1,2,...,p-1} and this contradicts with the fact that $d<p$

-
I think your argument is correct. +1 –  DonAntonio Dec 3 '13 at 11:14

## 1 Answer

Your solution is correct, and a slightly different approach (which ammounts to the same you wrote)

Hints:

(1) Wilson's Theorem

(2) For any prime $\;q\;,\;\;q<p\;$ , we have that $\;q\mid (p-1)!\implies q\nmid \left[(p-1!+1\right]\;$ ...

-
Wow, thank you so much! –  walterudoing Dec 3 '13 at 11:17
@walterudoing, it is considered a nice thing in this site to upvote any answer that you find helpful. After a while, you can accept the best of all answers. –  DonAntonio Dec 3 '13 at 12:26