Wilson's theorem

Theorem on prime numbers From Wikipedia, the free encyclopedia

In algebra and number theory, Wilson's theorem states that a natural number n > 1 is a prime number if and only if the product of all the positive integers less than n is one less than a multiple of n. That is (using the notations of modular arithmetic), the factorial satisfies

exactly when n is a prime number. In other words, any integer n > 1 is a prime number if, and only if, (n1)! + 1 is divisible by n.[1]

History

The theorem was first stated by Ibn al-Haytham c.1000 AD.[2] Edward Waring announced the theorem in 1770 without proving it, crediting his student John Wilson for the discovery.[3] Lagrange gave the first proof in 1771.[4] There is evidence that Leibniz was also aware of the result a century earlier, but never published it.[5]

Example

For each of the values of n from 2 to 30, the following table shows the number (n1)! and the remainder when (n1)! is divided by n. (In the notation of modular arithmetic, the remainder when m is divided by n is written m mod n.) The background color is blue for prime values of n, gold for composite values.

More information , ...
Table of factorial and its remainder modulo n

(sequence A000142 in the OEIS)

(sequence A061006 in the OEIS)
211
322
462
5244
61200
77206
850400
9403200
103628800
11362880010
12399168000
1347900160012
1462270208000
15871782912000
1613076743680000
172092278988800016
183556874280960000
19640237370572800018
201216451004088320000
2124329020081766400000
22510909421717094400000
23112400072777760768000022
24258520167388849766400000
256204484017332394393600000
26155112100433309859840000000
274032914611266056355840000000
28108888694504183521607680000000
2930488834461171386050150400000028
3088417619937397019545436160000000
Close

Proofs

Summarize
Perspective

As a biconditional (if and only if) statement, the proof has two halves: to show that equality does not hold when is composite, and to show that it does hold when is prime.

Composite modulus

Suppose that is composite. Therefore, it is divisible by some prime number where . Because divides , there is an integer such that . Suppose for the sake of contradiction that were congruent to modulo . Then would also be congruent to modulo : indeed, if then for some integer , and consequently is one less than a multiple of . On the other hand, since , one of the factors in the expanded product is . Therefore . This is a contradiction; therefore it is not possible that when is composite.

In fact, more is true. With the sole exception of the case , where , if is composite then is congruent to 0 modulo . The proof can be divided into two cases: First, if can be factored as the product of two unequal numbers, , where , then both and will appear as factors in the product and so is divisible by . If has no such factorization, then it must be the square of some prime larger than 2. But then , so both and will be factors of , and so divides in this case, as well.

Prime modulus

The first two proofs below use the fact that the residue classes modulo a prime number form a finite field (specifically, a prime field).[6]

Elementary proof

The result is trivial when , so assume is an odd prime, . Since the residue classes modulo form a field, every non-zero residue has a unique multiplicative inverse . Euclid's lemma implies[a] that the only values of for which are . Therefore, with the exception of , the factors in the expanded form of can be arranged in disjoint pairs such that product of each pair is congruent to 1 modulo . This proves Wilson's theorem.

For example, for , one has

Proof using Fermat's little theorem

Again, the result is trivial for p = 2, so suppose p is an odd prime, p ≥ 3. Consider the polynomial

g has degree p − 1, leading term xp − 1, and constant term (p − 1)!. Its p − 1 roots are 1, 2, ..., p − 1.

Now consider

h also has degree p − 1 and leading term xp − 1. Modulo p, Fermat's little theorem says it also has the same p − 1 roots, 1, 2, ..., p − 1.

Finally, consider

f has degree at most p  2 (since the leading terms cancel), and modulo p also has the p − 1 roots 1, 2, ..., p − 1. But Lagrange's theorem says it cannot have more than p  2 roots. Therefore, f must be identically zero (mod p), so its constant term is (p − 1)! + 1 ≡ 0 (mod p). This is Wilson's theorem.

Proof using the Sylow theorems

It is possible to deduce Wilson's theorem from a particular application of the Sylow theorems. Let p be a prime. It is immediate to deduce that the symmetric group has exactly elements of order p, namely the p-cycles . On the other hand, each Sylow p-subgroup in is a copy of . Hence it follows that the number of Sylow p-subgroups is . The third Sylow theorem implies

Multiplying both sides by (p − 1) gives

that is, the result.

Applications

Summarize
Perspective

Primality tests

In practice, Wilson's theorem is useless as a primality test because computing (n − 1)! modulo n for large n is computationally complex, and much faster primality tests are known (indeed, even trial division is considerably more efficient).[citation needed]

Used in the other direction, to determine the primality of the successors of large factorials, it is indeed a very fast and effective method. This is of limited utility, however.[citation needed]

Quadratic residues

Using Wilson's Theorem, for any odd prime p = 2m + 1, we can rearrange the left hand side of to obtain the equality This becomes or We can use this fact to prove part of a famous result: for any prime p such that p  1 (mod 4), the number (−1) is a square (quadratic residue) mod p. For this, suppose p = 4k + 1 for some integer k. Then we can take m = 2k above, and we conclude that (m!)2 is congruent to (−1) (mod p).

Formulas for primes

Wilson's theorem has been used to construct formulas for primes, but they are too slow to have practical value.

p-adic gamma function

Wilson's theorem allows one to define the p-adic gamma function.

Gauss's generalization

Gauss proved[7][non-primary source needed] that where p represents an odd prime and a positive integer. That is, the product of the positive integers less than m and relatively prime to m is one less than a multiple of m when m is equal to 4, or a power of an odd prime, or twice a power of an odd prime; otherwise, the product is one more than a multiple of m. The values of m for which the product is −1 are precisely the ones where there is a primitive root modulo m.

See also

Notes

References

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.