Math 2.0

Number theory Proof

Proof of Pépin's test

Builds on Fermat numberCongruence modulo nPrime numberLegendre symbolQuadratic residueLaw of quadratic reciprocityEuler's criterionUnits of Z/nZ are the residues coprime to nGroup of units of a ringg to the n equals 1 iff the order divides nOrder of an element divides the order of the groupOrder of the group of units of Z/nZ is Euler's totientEuler's totient function

Proof

Let n≥1n \ge 1 and F=Fn=22n+1F = F_n = 2^{2^n} + 1, a Fermat number. Put e=(F−1)/2=22n−1e = (F - 1)/2 = 2^{2^n - 1}. Congruences are modulo FF unless stated.

If FF is prime, then 3e≡−13^e \equiv -1.

  1. Since n≥1n \ge 1, we have 2n≥22^n \ge 2, so 44 divides 22n2^{2^n}. Hence F≡1(mod4)F \equiv 1 \pmod 4, and F≥5F \ge 5.
  2. Also 22n=42n−1≡1(mod3)2^{2^n} = 4^{2^{n-1}} \equiv 1 \pmod 3. Hence F≡2(mod3)F \equiv 2 \pmod 3.
  3. Assume FF is prime. Then FF and 33 are distinct odd primes.
  4. By the law of quadratic reciprocity, with Legendre symbols, (3F)(F3)=(−1)1⋅e=1\left(\frac{3}{F}\right)\left(\frac{F}{3}\right) = (-1)^{1 \cdot e} = 1, because ee is even.
  5. The squares modulo 33 are 02≡00^2 \equiv 0, 12≡11^2 \equiv 1 and 22≡12^2 \equiv 1. So F≡2F \equiv 2 is a quadratic nonresidue modulo 33, and (F3)=−1\left(\frac{F}{3}\right) = -1.
  6. By step 4, (3F)=−1\left(\frac{3}{F}\right) = -1.
  7. By Euler's criterion, 3e≡(3F)=−1(modF)3^e \equiv \left(\frac{3}{F}\right) = -1 \pmod F.

If 3e≡−13^e \equiv -1, then FF is prime.

  1. Assume 3e≡−1(modF)3^e \equiv -1 \pmod F. A common divisor of 33 and FF divides 3e3^e and 3e+13^e + 1, hence divides 11. So gcd⁡(3,F)=1\gcd(3, F) = 1.
  2. So the class [3][3] lies in the group G=(ℤ/Fℤ)×G = (\Z/F\Z)^\times of units, by the units of Z/nZ. Let rr be its order in GG.
  3. Squaring the assumption gives 32e=3F−1≡13^{2e} = 3^{F-1} \equiv 1. By the order criterion, rr divides F−1=22nF - 1 = 2^{2^n}. So r=2jr = 2^j with 0≤j≤2n0 \le j \le 2^n.
  4. If j<2nj < 2^n, then rr divides e=22n−1e = 2^{2^n - 1}, so 3e≡13^e \equiv 1. With 3e≡−13^e \equiv -1 this gives F∣2F \mid 2, which is false since F≥5F \ge 5.
  5. So r=22n=F−1r = 2^{2^n} = F - 1.
  6. The order of an element divides the order of the group. The group GG has φ(F)\varphi(F) elements, by the order of the units group. So F−1≤φ(F)F - 1 \le \varphi(F).
  7. By the definition of Euler's totient function, φ(F)\varphi(F) counts integers kk with 1≤k≤F1 \le k \le F coprime to FF. The integer k=Fk = F is not coprime to F>1F > 1, so φ(F)≤F−1\varphi(F) \le F - 1.
  8. Hence φ(F)=F−1\varphi(F) = F - 1, and each kk with 1≤k≤F−11 \le k \le F - 1 is coprime to FF.
  9. If dd were a divisor of FF with 1<d<F1 < d < F, then gcd⁡(d,F)=d>1\gcd(d, F) = d > 1, contrary to step 15. So FF is prime.

Idea

If FnF_n is prime, quadratic reciprocity shows that 33 is not a square modulo FnF_n, and Euler's criterion turns this into the congruence. Conversely, the congruence makes the order of 33 equal to Fn−1F_n - 1. Only a prime modulus has that many units.

Reading path

To understand this page from the ground up, read these 184 pages in order. The foundations come first. The path takes the proofs Proof of Bézout's identity, Proof of cancellation in an integral domain, Proof of the approximation property of the supremum, Proof of Gauss's lemma on quadratic residues, Proof of the generalized Euclid's lemma, Proof of Eisenstein's lemma, Proof of the commutativity of addition by induction, Proof of Fermat's little theorem by rearrangement, Proof that equivalence classes form a partition, Proof that g to the n equals 1 iff the order divides n, Proof of Euclid's lemma, Proof that R[x] is an integral domain iff R is, Proof that the reals form an ordered field, with the Cauchy sequence construction, Proof that the order of the group of units of Z/nZ is Euler's totient, Proof of the law of quadratic reciprocity by counting lattice points, Proof that the order of an element divides the order of the group, Proof of the degree of a product over an integral domain, Proof of strong induction from ordinary induction, Proof of the laws of exponents in a group, Proof that the integers modulo a prime form a field, Proof that congruence is compatible with addition, Proof of Euler's criterion by counting quadratic residues, Proof of the second supplement to quadratic reciprocity from Gauss's lemma, Proof that a polynomial over a field has at most as many roots as its degree, Proof of the remainder theorem, Proof that congruence is compatible with multiplication, Proof that the order of a cyclic subgroup equals the order of its generator, Proof of the well-ordering principle from strong induction, Proof of the division algorithm, Proof of the uniqueness of inverses, Proof of the first supplement to quadratic reciprocity from Euler's criterion, Proof that the reals are Archimedean from the completeness axiom, Proof that the units of Z/nZ are the residues coprime to n, Proof of Lagrange's theorem, Proof of the factor theorem, Proof that cosets have the same cardinality as the subgroup, Proof that congruence is compatible with powers.

  1. Binary operation definition
  2. Construction of the reals from Cauchy sequences concept
  3. Definition by recursion concept
  4. Divisibility definition
  5. Element definition
  6. Fermat number definition
  7. Group concept
  8. Group of units of Z/nZ object
  9. Integers object
  10. Left coset concept
  11. Mathematical induction concept
  12. Natural numbers object
  13. Ordered field definition
  14. Peano axioms concept
  15. Proposition concept
  16. Rational numbers object
  17. Real numbers object
  18. Set bounded above definition
  19. Associativity definition
  20. Identity element definition
  21. Congruence modulo n definition
  22. Greatest common divisor definition
  23. Prime number definition
  24. Set definition
  25. Order of a group definition
  26. Ring definition
  27. Subgroup definition
  28. Ring of integers statement
  29. Archimedean ordered field definition
  30. Successor function definition
  31. Conjunction definition
  32. Disjunction definition
  33. Implication definition
  34. Predicate definition
  35. The reals form a field statement
  36. Supremum definition
  37. Semigroup definition
  38. Inverse element definition
  39. Quadratic residue definition
  40. Residue class definition
  41. Proof that congruence is compatible with addition proof
  42. Proof that congruence is compatible with multiplication proof
  43. Coprime integers definition
  44. Empty set object
  45. Family of sets definition
  46. Ordered pair definition
  47. Commutative ring definition
  48. Intersection definition
  49. Polynomial ring definition
  50. Ring homomorphism definition
  51. Unit of a ring definition
  52. Zero divisor definition
  53. Union definition
  54. Addition of natural numbers definition
  55. Left coset definition
  56. Right coset definition
  57. Set-builder notation concept
  58. The rationals form a field statement
  59. The successor function is injective statement
  60. Zero is not a successor statement
  61. Biconditional definition
  62. Existential quantifier definition
  63. Universal quantifier definition
  64. Completeness axiom statement
  65. Monoid definition
  66. Congruence is compatible with addition statement
  67. Legendre symbol definition
  68. Congruence is compatible with multiplication statement
  69. Proof of the uniqueness of inverses proof
  70. Euler's totient function definition
  71. Cartesian product definition
  72. Disjoint sets definition
  73. Divisibility in a commutative ring definition
  74. Group of units of a ring definition
  75. Degree of a polynomial definition
  76. Field definition
  77. Polynomial evaluation definition
  78. Subset definition
  79. Integral domain definition
  80. Proof of the commutativity of addition by induction proof
  81. Order on the natural numbers definition
  82. Axiom of extensionality statement
  83. Union of a family of sets definition
  84. The rationals form an ordered field statement
  85. Uniqueness quantifier definition
  86. Group of units of a monoid definition
  87. Integers modulo n definition
  88. Proof that congruence is compatible with powers proof
  89. Uniqueness of inverses statement
  90. Binary relation definition
  91. Leading coefficient definition
  92. Order on the reals definition
  93. Proof of cancellation in an integral domain proof
  94. Root of a polynomial definition
  95. Evaluation homomorphism definition
  96. Partition of a set definition
  97. Commutativity of addition statement
  98. Proof of strong induction from ordinary induction proof
  99. Congruence is compatible with powers statement
  100. Antisymmetric relation definition
  101. Reflexive relation definition
  102. Symmetric relation definition
  103. Transitive relation definition
  104. Proof of the laws of exponents in a group proof
  105. Monic polynomial definition
  106. Multiplicity of a root definition
  107. Proof of the degree of a product over an integral domain proof
  108. Cancellation in an integral domain statement
  109. Proof of the remainder theorem proof
  110. Function definition
  111. Strong induction statement
  112. Equivalence relation definition
  113. Preorder definition
  114. Laws of exponents in a group statement
  115. Degree of a product statement
  116. Division algorithm for polynomials statement
  117. Codomain definition
  118. Injective function definition
  119. Proof of the well-ordering principle from strong induction proof
  120. Partial order definition
  121. Order of an element definition
  122. Cyclic subgroup generated by an element definition
  123. Surjective function definition
  124. Remainder theorem statement
  125. Proof that R[x] is an integral domain iff R is proof
  126. Equivalence class definition
  127. Well-ordering principle statement
  128. Total order definition
  129. Bijective function definition
  130. Proof of the division algorithm proof
  131. Proof of the factor theorem proof
  132. Proof that equivalence classes form a partition proof
  133. R[x] is an integral domain iff R is statement
  134. Equinumerous sets definition
  135. Division algorithm statement
  136. Factor theorem statement
  137. Equivalence classes form a partition statement
  138. Proof that the reals form an ordered field, with the Cauchy sequence construction proof
  139. Cardinality definition
  140. Proof that g to the n equals 1 iff the order divides n proof
  141. Proof of Bézout's identity proof
  142. Proof that a polynomial over a field has at most as many roots as its degree proof
  143. The reals form an ordered field statement
  144. g to the n equals 1 iff the order divides n statement
  145. Bézout's identity statement
  146. A polynomial over a field has at most as many roots as its degree statement
  147. Proof that cosets have the same cardinality as the subgroup proof
  148. Proof of the approximation property of the supremum proof
  149. Proof that the order of a cyclic subgroup equals the order of its generator proof
  150. Proof of the generalized Euclid's lemma proof
  151. Proof that the integers modulo a prime form a field proof
  152. Proof that the units of Z/nZ are the residues coprime to n proof
  153. Cosets have the same cardinality as the subgroup statement
  154. Approximation property of the supremum statement
  155. Order of a cyclic subgroup equals the order of its generator statement
  156. Integers modulo a prime form a field statement
  157. Generalized Euclid's lemma statement
  158. Units of Z/nZ are the residues coprime to n statement
  159. Proof of Lagrange's theorem proof
  160. Proof that the reals are Archimedean from the completeness axiom proof
  161. Proof that the order of the group of units of Z/nZ is Euler's totient proof
  162. Proof of Euclid's lemma proof
  163. Lagrange's theorem statement
  164. The reals are Archimedean statement
  165. Proof that the order of an element divides the order of the group proof
  166. Euclid's lemma statement
  167. Order of the group of units of Z/nZ is Euler's totient statement
  168. Floor function definition
  169. Order of an element divides the order of the group statement
  170. Proof of Fermat's little theorem by rearrangement proof
  171. Fermat's little theorem statement
  172. Proof of Euler's criterion by counting quadratic residues proof
  173. Euler's criterion statement
  174. Proof of the first supplement to quadratic reciprocity from Euler's criterion proof
  175. Proof of Gauss's lemma on quadratic residues proof
  176. Proof of Eisenstein's lemma proof
  177. First supplement to quadratic reciprocity statement
  178. Gauss's lemma on quadratic residues statement
  179. Eisenstein's lemma statement
  180. Proof of the second supplement to quadratic reciprocity from Gauss's lemma proof
  181. Proof of the law of quadratic reciprocity by counting lattice points proof
  182. Second supplement to quadratic reciprocity statement
  183. Law of quadratic reciprocity statement
  184. Proof of Pépin's test proof

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/P%C3%A9pin%27s_test, Proof of correctness
About this page
Tag5F18K7X480
URIm2://5F18K7X480
Kindproof
WritingW0 stub
MSC11Y11
ProvesPépin's test
UsesFermat number, Congruence modulo n, Prime number, Legendre symbol, Quadratic residue, Law of quadratic reciprocity, Euler's criterion, Units of Z/nZ are the residues coprime to n, Group of units of a ring, g to the n equals 1 iff the order divides n, Order of an element divides the order of the group, Order of the group of units of Z/nZ is Euler's totient, Euler's totient function
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.