The theorem is named after John Wilson, who was a mathematician in Cambridge. He first stated it in 1770, as follows :-
A natural number n > 1 is a prime number, if and only if, (n-1)! ≡ -1 (mod n).
Aargh! How scary is that expression!
I discovered this formula in my spare time over the space of one year. Of course, I had never heard of it or Wilson and thought I had found the perfect formula to generate primes. After months of searching I found references to it in two old books on number theory, and realised I was 240 years too late.
I always state my version of the theorem as follows :-
If (n+1) is a factor of (n!+1) then (n+1) is a prime,
If the remainder when (n!+1)/(n+1) = 0, then (n+1) is a prime.
I feel that these expressions are easier to remember than Wilson's version (I also feel uneasy about negative remainders).
This page was prepared by and is the Copyright © 2012 of A.J. Bacsich.