Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Wilson's theorem states that a natural number $n>1$ is a prime number if and only if

$$ (n-1)! \equiv -1 \pmod {n} $$

Can we prove it using Fermat's Little theorem? If yes, then how?

share|cite|improve this question… – draks ... Dec 20 '12 at 16:42
Proving that if $n\gt 1$ and $(n-1)!\equiv -1\pmod{n}$ then $n$ is prime will not involve Fermat's Theorem, but that is the easy direction. – André Nicolas Dec 20 '12 at 18:21
up vote 5 down vote accepted

Hint: Consider $(x-1)(x-2)...(x-(p-1))$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.