 #jsDisabledContent { display:none; } My Account | Register | Help Flag as Inappropriate This article will be permanently flagged as inappropriate and made unaccessible to everyone. Are you certain this article is inappropriate?          Excessive Violence          Sexual Content          Political / Social Email this Article Email Address:

# Wilson prime

Article Id: WHEBN0000323646
Reproduction Date:

 Title: Wilson prime Author: World Heritage Encyclopedia Language: English Subject: Collection: Publisher: World Heritage Encyclopedia Publication Date:

### Wilson prime

 Named after John Wilson 1938 Emma Lehmer 3 5, 13, 563 563 A007540

A Wilson prime, named after English mathematician John Wilson, is a prime number p such that p2 divides (p − 1)! + 1, where "!" denotes the factorial function; compare this with Wilson's theorem, which states that every prime p divides (p − 1)! + 1.

The only known Wilson primes are 5, 13, and 563 (sequence A007540 in OEIS); 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 [xy] is about log(log(y)/log(x)).

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 is coordinated at the mersenneforum.

## Contents

• Generalizations 1
• Wilson primes of order n 1.1
• Near-Wilson primes 1.2
• Wilson numbers 1.3
• Notes 3
• References 4

## Generalizations

### Wilson primes of order n

Wilson's theorem can be expressed in general as (n-1)!(p-n)!=(-1)^n\ \bmod p for every prime p \le n. Generalized Wilson primes of order n are the primes p such that p^2 divides (n-1)!(p-n)! - (-1)^n.

It's a conjecture that for every natural number n, there are infinitely many Wilson primes of order n.

n prime p such that p^2 divides (n-1)!(p-n)! - (-1)^n OEIS sequence
1 5, 13, 563, ... A007540
2 2, 3, 11, 107, 4931, ... A079853
3 7, ...
4 10429, ...
5 5, 7, 47, ...
6 11, ...
7 17, ...
8 ...
9 541, ...
10 11, 1109, ...
11 17, 2713, ...
12 ...
13 13, ...
14 ...
15 349, ...
16 31, ...
17 61, 251, 479, ... A152413
18 13151527, ...
19 71, ...
20 59, 499, ...
21 217369, ...
22 ...
23 ...
24 47, 3163, ...
25 ...
26 97579, ...
27 53, ...
28 347, ...
29 ...
30 137, 1109, 5179, ...

Least generalized Wilson number of order n are

5, 2, 7, 10429, 5, 11, 17, ... (The next term > 1.4×107) (sequence A128666 in OEIS)

### Near-Wilson primes

A prime p satisfying the congruence (p − 1)! ≡ − 1 + Bp mod p2 with small |B| can be called a near-Wilson prime. Near-Wilson primes with B = 0 represent Wilson primes. The following table lists all such primes with |B| ≤ 100 from 106 up to 4×1011:

### Wilson numbers

A Wilson number is a natural number n such that W(n) ≡ 0 (mod n2), where W(n) = \left(\prod_{1<=k<=n,gcd(k,n)=1}{k}\right)+e, the constant e = 1 if and only if n have a primitive root, otherwise, e = -1. For every natural number n, W(n) is divisible by n, and the quotients (called generalized Wilson quotients) are listed in  A157249. The Wilson numbers are

1, 5, 13, 563, 5971, 558771, 1964215, 8121909, 12326713, 23025711, 26921605, 341569806, 399292158, ... (sequence A157250 in OEIS)

If a Wilson number n is prime, then n is a Wilson prime. There are 13 Wilson numbers up to 5×108.