Home
Search Site
Largest
The 5000
Top 20
Finding
How Many?
Mersenne
Glossary
Prime Curios!
Prime Lists
FAQ
email list
Titans
Submit primes

In 1770 Edward Waring announced the following theorem by his former
student John Wilson.
 Wilson's Theorem.
 Let p be an integer greater than one. p is prime
if and only if (p1)! = 1 (mod p).
This beautiful result is of mostly theoretical value because it is relatively
difficult to calculate (p1)! In contrast it is easy to calculate
a^{p1}, so elementary primality tests are built
using Fermat's Little Theorem rather than
Wilson's.
Neither Waring or Wilson could prove the above theorem, but now it can
be found in any elementary number theory text. To save you some time we
present a proof here.
 Proof.

It is easy to check the result when p is 2 or 3, so let us
assume p > 3.
If p is composite, then its positive divisors
are among the integers
1, 2, 3, 4, ... , p1
and it is clear that gcd((p1)!,p) > 1, so we can not
have (p1)! = 1 (mod p).
However if p is prime, then each of the above
integers are relatively prime to p. So for each of these integers
a there is another b such that ab = 1
(mod p). It is important to note that this b is unique
modulo p, and that since p is prime, a = b
if and only if a is 1 or p1. Now if we omit 1 and
p1, then the others can be grouped into pairs whose
product is one showing
2^{.}3^{.}4^{.}...^{.}(p2)
= 1 (mod p)
(or more simply (p2)! = 1 (mod p)). Finally, multiply
this equality by p1 to complete the proof.
