Wilson's theorem

E530311

Wilson's theorem is a result in number theory stating that a positive integer n > 1 is prime if and only if the factorial of (n − 1) is congruent to −1 modulo n.

Try in SPARQL Jump to: Surface forms Statements Referenced by

Observed surface forms (1)

Surface form Occurrences
Wilson’s theorem 1

Statements (43)

Predicate Object
instanceOf theorem in number theory
appearsIn elementary number theory textbooks
appliesTo positive integers n > 1
assumes n is an integer greater than 1
canBeProvedUsing pairing of inverses modulo p
properties of multiplicative group modulo p
category results about primes
results in modular arithmetic
characterizes prime numbers
equivalenceType if and only if condition
equivalentFormulation In (Z/pZ)*, the product of all elements equals −1.
The product of all nonzero residues modulo a prime p is congruent to −1 modulo p.
example For n = 4, (4 − 1)! = 6 ≡ 2 (mod 4), so 4 is not prime.
For n = 6, (6 − 1)! = 120 ≡ 0 (mod 6), so 6 is not prime.
For p = 5, (5 − 1)! = 24 ≡ −1 (mod 5).
For p = 7, (7 − 1)! = 720 ≡ −1 (mod 7).
failsFor composite numbers n > 4
field number theory
generalization Wilson primes
givesConditionFor n to be prime
hasConsequence If (n − 1)! is not congruent to −1 modulo n, then n is composite.
If p is prime, then (p − 1)! + 1 is a multiple of p.
historicalAttribution first published proof by Joseph-Louis Lagrange
known to Ibn al-Haytham (Alhazen) before Wilson
holdsFor every prime number p
implies If (n − 1)! ≡ −1 (mod n), then n is prime.
If n is prime, then (n − 1)! + 1 is divisible by n.
involvesOperation multiplication of all nonzero residues modulo n
isCriterionFor primality
isNot efficient primality test for large n
namedAfter John Wilson NERFINISHED
relatedTo Fermat's little theorem NERFINISHED
group of units modulo p
primality test
statement A positive integer n > 1 is prime if and only if (n − 1)! ≡ −1 (mod n).
For a prime p, (p − 1)! ≡ −1 (mod p).
If n is composite and n > 4, then (n − 1)! ≡ 0 (mod n).
usedAs example of a necessary and sufficient condition in number theory
usedIn theoretical characterization of primes
usesConcept congruence modulo n
factorial
modular arithmetic
yearProved 1771

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

Fermat's little theorem relatedTo Wilson's theorem
Euler’s theorem contrastsWith Wilson's theorem
this entity surface form: Wilson’s theorem