In number theory, a Wilson prime is a prime number such that divides , where "" denotes the factorial function; compare this with Wilson's theorem, which states that every prime divides . Both are named for 18th-century English mathematician John Wilson; in 1770, Edward Waring credited the theorem to Wilson, although it had been stated centuries earlier by Ibn al-Haytham. The only known Wilson primes are 5, 13, and 563 . Costa et al. write that "the case is trivial", and credit the observation that 13 is a Wilson prime to . Early work on these numbers included searches by N. G. W. H. Beeger and Emma Lehmer, but 563 was not discovered until the early 1950s, when computer searches could be applied to the problem. If any others exist, they must be greater than 2 × 1013. It has been conjectured that infinitely many Wilson primes exist, and that the number of Wilson primes in an interval is about . Several computer searches have been done in the hope of finding new Wilson primes. The Ibercivis distributed computing project includes a search for Wilson primes. Another search was coordinated at the Great Internet Mersenne Prime Search forum. Wilson's theorem can be expressed in general as for every integer and prime . Generalized Wilson primes of order n are the primes p such that divides . It was conjectured that for every natural number n, there are infinitely many Wilson primes of order n. The smallest generalized Wilson primes of order are: A prime satisfying the congruence with small can be called a near-Wilson prime. Near-Wilson primes with are bona fide Wilson primes. The table on the right lists all such primes with from up to 4. A Wilson number is a natural number such that , where and where the term is positive if and only if has a primitive root and negative otherwise. For every natural number , is divisible by , and the quotients (called generalized Wilson quotients) are listed in . The Wilson numbers are If a Wilson number is prime, then is a Wilson prime. There are 13 Wilson numbers up to 5.
Kim-Manuel Klein, Klaus Jansen, Alexandra Anna Lassota