|
|
Line 1: |
Line 1: |
| In [[number theory]], '''Wilson's theorem''' states that a natural number ''n'' > 1 is a [[prime number]] [[if and only if]]
| | The author is known the particular name of [http://Photobucket.com/images/Gabrielle+Lattimer Gabrielle Lattimer] though she doesn't surely like being called in this way. To bake is something that my wife been doing for long [http://periods.com/ periods] of time. Her job would be a cashier but rather quickly her husband and your spouse will start their own business. She's always loved living in the South Carolina. She is running and exercising a blog here: http://prometeu.net<br><br>my site: [http://prometeu.net hack clash of clans ifunbox] |
| | |
| :<math>(n-1)!\ \equiv\ -1 \pmod n</math>.
| |
| | |
| That is, it asserts that the [[factorial]] <math>(n - 1)! = 1 \times 2 \times 3 \times \cdots \times (n - 1)</math> is one less than a multiple of ''n'' exactly when ''n'' is a prime number.
| |
| | |
| ==History==
| |
| This theorem was stated by [[Ibn al-Haytham]] (c. 1000 AD),<ref>{{MacTutor Biography|id=Al-Haytham|title=Abu Ali al-Hasan ibn al-Haytham}}</ref> and [[John Wilson (mathematician)|John Wilson]].<ref>Edward Waring, ''Mediationes Algebraicae'' (Cambridge, England: 1770), page 218 (in Latin). In the third (1782) edition of Waring's ''Mediationes Algebraicae'', Wilson's theorem appears as problem 5 on [http://books.google.co.uk/books?id=1MNbAAAAQAAJ&pg=PA380#v=onepage&f=false page 380]. On that page, Waring states: "Hanc maxime elegantem primorum numerorum proprietatem invenit vir clarissimus, rerumque mathematicarum peritissimus Joannes Wilson Armiger." (A man most illustrious and most skilled in mathematics, Squire John Wilson, found this most elegant property of prime numbers.)</ref> [[Edward Waring]] announced the theorem in 1770, although neither he nor his student Wilson could prove it. [[Joseph Louis Lagrange|Lagrange]] gave the first proof in 1771.<ref>Joseph Louis Lagrange, [http://books.google.com/books?id=_-U_AAAAYAAJ&pg=PA125#v=onepage&q&f=false "Demonstration d'un théorème nouveau concernant les nombres premiers"] (Proof of a new theorem concerning prime numbers), ''Nouveaux Mémoires de l'Académie Royale des Sciences et Belles-Lettres'' (Berlin), vol. 2, pages 125–137 (1771).</ref> There is evidence that [[Gottfried Leibniz|Leibniz]] was also aware of the result a century earlier, but he never published it.<ref>Giovanni Vacca (1899) "Sui manoscritti inediti di Leibniz" (On unpublished manuscripts of Leibniz),
| |
| ''Bollettino di bibliografia e storia delle scienze matematiche'' ... (Bulletin of the bibliography and history of mathematics), vol. 2, pages 113-116; see [http://books.google.com/books?id=vqwSAQAAMAAJ&pg=PA114#v=onepage&q&f=false page 114] (in Italian). Vacca quotes from Leibniz's mathematical manuscripts kept at the Royal Public Library in Hanover (Germany), vol. 3 B, bundle 11, page 10: <blockquote>''Original'' : Inoltre egli intravide anche il teorema di Wilson, come risulta dall'enunciato seguente:<br /><br />"Productus continuorum usque ad numerum qui antepraecedit datum divisus per datum relinquit 1 (vel complementum ad unum?) si datus sit primitivus. Si datus sit derivativus relinquet numerum qui cum dato habeat communem mensuram unitate majorem."<br /><br />Egli non giunse pero a dimostrarlo.</blockquote><blockquote>''Translation'' : In addition, he [Leibniz] also glimpsed Wilson's theorem, as shown in the following statement: <br /><br />"The product of all integers preceding the given integer, when divided by the given integer, leaves 1 (or the complement of 1?) if the given integer be prime. If the given integer be composite, it leaves a number which has a common factor with the given integer [which is] greater than one."<br /><br />However, he didn't succeed in proving it.</blockquote> See also: Giuseppe Peano, ed., ''Formulaire de mathématiques'', vol. 2, no. 3, [http://books.google.com/books?id=bfDuAAAAMAAJ&pg=PA85#v=onepage&q&f=false page 85] (1897).</ref> | |
| | |
| == Example ==
| |
| The following table shows the values of ''n'' from 2 to 30, (''n'' − 1)!, and the remainder when (''n'' − 1)! 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 <span style="background-color:#FFC0CB">pink</span> for prime values of ''n'', <span style="background-color:#98FB98">pale green</span> for composite values.
| |
| {| class="wikitable" style="text-align:right"
| |
| |+ Table of remainder modulo ''n''
| |
| ! <math>n</math> !! <math>(n-1)!</math> !! <math>(n-1)!\ \bmod\ n</math>
| |
| |- style="background-color:#FFC0CB"
| |
| | 2 || 1 || 1
| |
| |- style="background-color:#FFC0CB"
| |
| | 3 || 2 || 2
| |
| |- style="background-color:#98FB98"
| |
| | 4 || 6 || 2
| |
| |- style="background-color:#FFC0CB"
| |
| | 5 || 24 || 4
| |
| |- style="background-color:#98FB98"
| |
| | 6 || 120 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 7 || 720 || 6
| |
| |- style="background-color:#98FB98"
| |
| | 8 || 5040 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 9 || 40320 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 10 || 362880 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 11 || 3628800 || 10
| |
| |- style="background-color:#98FB98"
| |
| | 12 || 39916800 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 13 || 479001600 || 12
| |
| |- style="background-color:#98FB98"
| |
| | 14 || 6227020800 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 15 || 87178291200 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 16 || 1307674368000 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 17 || 20922789888000 || 16
| |
| |- style="background-color:#98FB98"
| |
| | 18 || 355687428096000 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 19 || 6402373705728000 || 18
| |
| |- style="background-color:#98FB98"
| |
| | 20 || 121645100408832000 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 21 || 2432902008176640000 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 22 || 51090942171709440000 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 23 || 1124000727777607680000 || 22
| |
| |- style="background-color:#98FB98"
| |
| | 24 || 25852016738884976640000 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 25 || 620448401733239439360000 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 26 || 15511210043330985984000000 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 27 || 403291461126605635584000000 || 0
| |
| |- style="background-color:#98FB98"
| |
| | 28 || 10888869450418352160768000000 || 0
| |
| |- style="background-color:#FFC0CB"
| |
| | 29 || 304888344611713860501504000000 || 28
| |
| |- style="background-color:#98FB98"
| |
| | 30 || 8841761993739701954543616000000 || 0
| |
| |}
| |
| | |
| ==Proofs==
| |
| | |
| Both of the proofs (for prime moduli)<ref>Landau, two proofs of thm. 78</ref> below make use of the fact that the residue classes modulo a prime number are a [[finite field|field]] -- see the article [[Characteristic_(algebra)#Case_of_fields|prime field]] for more details. [[Lagrange's theorem (number theory)|Lagrange's theorem]], which states that in any field a polynomial of degree ''n'' has at most ''n'' roots, is needed for both proofs.
| |
| | |
| ===Composite modulus===
| |
| | |
| If ''n'' is composite it is divisible by some prime number ''q'', where {{nowrap|1=2 ≤ ''q'' ≤ ''n'' − 2}}. If {{nowrap|1=(''n'' − 1)!}} were congruent to {{nowrap|1=−1 (mod ''n'')}} then it would also be congruent to −1 (mod ''q''). But (''n'' − 1)! ≡ 0 (mod ''q'').
| |
| | |
| In fact, more is true. With the sole exception of 4, where 3! = 6 ≡ 2 (mod 4), if ''n'' is composite then (''n'' − 1)! is congruent to 0 (mod ''n''). The proof is divided into two cases: First, if ''n'' can be factored as the product of two unequal numbers, {{nowrap|1=''n'' = ''ab''}}, where 2 ≤ ''a'' < ''b'' ≤ ''n'' − 2, then both ''a'' and ''b'' will appear in the product {{nowrap|1=1 × 2 × ... × (''n'' − 1) = (''n'' − 1)!}} and (''n'' − 1)! will be divisible by ''n''. If ''n'' has no such factorization, then it must be the square of some prime ''q'', ''q'' > 2. But then 2''q'' < ''q''<sup>2</sup> = ''n'', both ''q'' and 2''q'' will be factors of (''n'' − 1)!, and again ''n'' divides (''n'' − 1)!.
| |
| | |
| ===Prime modulus===
| |
| | |
| The result is trivial when {{nowrap|1=''p'' = 2}}, so assume ''p'' is an odd prime, {{nowrap|1=''p'' ≥ 3}}. Since the residue classes (mod ''p'') are a field, every non-zero ''a'' has a unique multiplicative inverse, ''a''<sup>−1</sup>. Lagrange's theorem implies that the only values of ''a'' for which {{nowrap|1=''a'' ≡ ''a''<sup>−1</sup> (mod ''p'')}} are {{nowrap|1=''a'' ≡ ±1 (mod ''p'')}} (because the congruence {{nowrap|1=''a''<sup>2</sup> ≡ 1}} can have at most two roots (mod ''p'').) Therefore, with the exception of ±1, the factors of {{nowrap|1=(''p'' − 1)!}} can be arranged in unequal pairs,<ref>When ''n'' = 3, the only factors are ±1</ref> where the product of each pair is {{nowrap|1=≡ 1 (mod ''p'')}}. This proves Wilson's theorem.
| |
| | |
| For example, if {{nowrap|1=''p'' = 11}},
| |
| | |
| :<math>10! = [(1\cdot10)]\cdot[(2\cdot6)(3\cdot4)(5\cdot9)(7\cdot8)] \equiv [-1]\cdot[1\cdot1\cdot1\cdot1] \equiv -1 \pmod{11}.\,</math>
| |
| | |
| ; Alternative proof
| |
| | |
| Again, the result is trivial for ''p'' = 2, so suppose ''p'' is an odd prime, {{nowrap|1=''p'' ≥ 3}}. Consider the polynomial
| |
| | |
| :<math>g(x)=(x-1)(x-2) \cdots (x-(p-1)).\,</math>
| |
| | |
| ''g'' has degree {{nowrap|1=''p'' − 1}}, leading term {{nowrap|1=''x''<sup>''p'' − 1</sup>}}, and constant term {{nowrap|1=(''p'' − 1)!}}. Its {{nowrap|1=''p'' − 1}} roots are 1, 2, ..., {{nowrap|1=''p'' − 1}}.
| |
| | |
| Now consider
| |
| | |
| :<math>h(x)=x^{p-1}-1.\,</math> | |
| | |
| ''h'' also has degree {{nowrap|1=''p'' − 1}} and leading term {{nowrap|1=''x''<sup>''p'' − 1</sup>}}. Modulo ''p'', [[Fermat's little theorem]] says it also has the same {{nowrap|1=''p'' − 1}} roots, 1, 2, ..., {{nowrap|1=''p'' − 1}}.
| |
| | |
| Finally, consider
| |
| :<math>f(x)=g(x)-h(x).\,</math> | |
| | |
| ''f'' has degree at most ''p'' − 2 (since the leading terms cancel), and modulo ''p'' also has the {{nowrap|1=''p'' − 1}} roots 1, 2, ..., {{nowrap|1=''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 {{nowrap|1=(''p'' − 1)! + 1 ≡ 0 (mod ''p'')}}. This is Wilson's theorem.
| |
| | |
| ==Applications==
| |
| Wilson's theorem is useless as a [[primality test]] in practice, since computing (''n'' − 1)! modulo ''n'' for large ''n'' is hard, and far easier primality tests are known (indeed, even [[trial division]] is considerably more efficient).
| |
| | |
| Using Wilson's Theorem, for any odd prime {{nowrap|1=''p'' = 2''m'' + 1}} we can rearrange the left hand side of
| |
| | |
| :<math>1\cdot 2\cdots (p-1)\ \equiv\ -1\ \pmod{p}</math>
| |
| | |
| to obtain the equality
| |
| | |
| :<math>1\cdot(p-1)\cdot 2\cdot (p-2)\cdots m\cdot (p-m)\ \equiv\ 1\cdot (-1)\cdot 2\cdot (-2)\cdots m\cdot (-m)\ \equiv\ -1 \pmod{p}.</math>
| |
| | |
| This becomes
| |
| | |
| :<math>\prod_{j=1}^m\ j^2\ \equiv(-1)^{m+1} \pmod{p}.</math>
| |
| | |
| 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 suppose ''p'' = 4''k'' + 1 for some integer ''k''. Then we can take ''m'' = 2''k'' above, and we conclude that
| |
| | |
| :<math>\biggl( \prod_{j=1}^{2k}\ j \biggr)^{2} = \prod_{j=1}^{2k}\ j^2\ \equiv (-1)^{2k+1}\ = -1 \pmod{p}.</math>
| |
| | |
| Wilson's theorem has been used to construct [[Formula for primes#Floor function formulas based on Wilson's theorem|formulas for primes]], but they are too slow to have practical value.
| |
| | |
| ==Gauss's generalization==
| |
| | |
| [[Carl Friedrich Gauss|Gauss]] proved<ref>Gauss, DA, art. 78</ref> that if ''m'' > 2
| |
| | |
| :<math> | |
| \prod_{k = 1 \atop \gcd(k,m)=1}^{m} \!\!k \ \equiv
| |
| \begin{cases}
| |
| -1 \pmod{m} & \text{if } m=4,\;p^\alpha,\;2p^\alpha \\
| |
| \;\;\,1 \pmod{m} & \text{otherwise}
| |
| \end{cases}
| |
| </math>
| |
| | |
| where ''p'' is an odd prime, and <math>\alpha</math> is a positive integer. The values of ''m'' for which the product is −1 are precisely the ones where there is a [[Primitive root modulo n|primitive root modulo ''m'']].<ref>{{nowrap|1=''m'' = 1 and 2}} have to be excluded because {{nowrap|1=1 ≡ −1 (mod 1 or 2)}}.</ref>
| |
| | |
| This further generalizes to the fact that in any finite [[abelian group]], either the product of all elements is the identity, or there is precisely one element ''a'' of order 2 (but not both). In the latter case, the product of all elements equals ''a''.
| |
| | |
| ==See also==
| |
| *[[Primitive root modulo n]]
| |
| *[[Wilson prime]]
| |
| *[[Ibn al-Haitham]]
| |
| *[[Table of congruences]]
| |
| | |
| ==Notes==
| |
| {{Reflist}}
| |
| | |
| ==References==
| |
| | |
| The ''[[Disquisitiones Arithmeticae]]'' has been translated from Gauss's Ciceronian Latin into English and German. The German edition includes all of his papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of the Gauss sum, the investigations into biquadratic reciprocity, and unpublished notes.
| |
| | |
| *{{citation
| |
| | last1 = Gauss | first1 = Carl Friedrich
| |
| | last2 = Clarke | first2 = Arthur A. (translator into English)
| |
| | title = Disquisitiones Arithemeticae (Second, corrected edition)
| |
| | publisher = [[Springer Science+Business Media|Springer]]
| |
| | location = New York
| |
| | year = 1986
| |
| | isbn = 0-387-96254-9}}
| |
| | |
| *{{citation
| |
| | last1 = Gauss | first1 = Carl Friedrich
| |
| | last2 = Maser | first2 = H. (translator into German)
| |
| | title = Untersuchungen über hohere Arithmetik (Disquisitiones Arithemeticae & other papers on number theory) (Second edition)
| |
| | publisher = Chelsea
| |
| | location = New York
| |
| | year = 1965
| |
| | isbn = 0-8284-0191-8}}
| |
| | |
| *{{citation
| |
| | last1 = Landau | first1 = Edmund
| |
| | title = Elementary Number Theory
| |
| | publisher = Chelsea
| |
| | location = New York
| |
| | year = 1966}}
| |
| | |
| *{{cite book
| |
| |authorlink=Oystein Ore
| |
| |last = Ore
| |
| |first = Oystein
| |
| |title = Number Theory and its History
| |
| |publisher = Dover
| |
| |year = 1988
| |
| |pages = 259–271
| |
| |isbn = 0-486-65620-9}}
| |
| | |
| ==External links==
| |
| * {{springer|title=Wilson theorem|id=p/w098010}}
| |
| *{{Mathworld|urlname=WilsonsTheorem|title=Wilson's Theorem}}
| |
| | |
| {{DEFAULTSORT:Wilson's Theorem}}
| |
| [[Category:Modular arithmetic]]
| |
| [[Category:Factorial and binomial topics]]
| |
| [[Category:Articles containing proofs]]
| |
| [[Category:Theorems about prime numbers]]
| |