# Wilson prime

By Wilson’s theorem we know that every prime p divides (p-1)!+1. p is a Wilson prime if p2 divides (p-1)!+1. For example 5 is a Wilson prime because 25 divides 4!+1=25. The only known Wilson primes are 5, 13, and 563; there are no others less than 500,000,000.

It is conjectured that the number of Wilson primes is infinite and that the number of such primes between x and y should be about log(log y/log x). So it may be awhile before we find the fourth such prime! So what about composite numbers? To define a Wilson composite we first need an analog of Wilson's theorem that applies to composites:

Theorem
Let n be an integer greater than one. Let m be the product of all of the positive integers less than n, but relatively prime to n (so m=(n-1)! if n is prime). n divides either m+1 or m-1.
We say a composite number n is a Wilson Composite if n2 divides either m+1 or m-1. The only such number below 50000 is 5971. Others include 558771, 1964215, 8121909 and 12326713; there are no others less than 10,000,000.