- Pépin's test
In
mathematics , Pépin's test is aprimality test , which can be used to determine whether aFermat number is prime. It is a variant of Proth's test. The test is named for a French mathematician, P. Pépin.Description of the test
Let be the "n"th Fermat number. Pépin's test states that if "n" is non-zero,: is prime if and only if .The expression can be evaluated modulo by repeated squaring. This makes the test a fast
polynomial-time algorithm. However, Fermat numbers grow so rapidly that only a handful of Fermat numbers can be tested in a reasonable amount of time and space.Other bases may be used in place of 3, for example 5, 6, 7, or 10 OEIS|id=A129802.
Proof of correctness
For one direction, assume that the congruence:holds. Then , thus the
multiplicative order of 3 modulo divides , which is a power of two. On the other hand, the order does not divide , and therefore it must be equal to . In particular, there are at least numbers below coprime to , and this can happen only if is prime.For the other direction, assume that is prime. By
Euler's criterion ,:,where is theLegendre symbol . By repeated squaring, we find that , thus , and .As , we conclude from thelaw of quadratic reciprocity .References
* P. Pépin, "Sur la formule ", "Comptes Rendus Acad. Sci. Paris" 85 (1877), pp. 329–333.
External links
* [http://primes.utm.edu/glossary/page.php?sort=PepinsTest The Prime Glossary: Pepin's test]
Wikimedia Foundation. 2010.