OFFSET
0,6
COMMENTS
For n=0 or n>=2 the Fermat Number F(n) is prime if and only if 5^((F(n) - 1)/2) is congruent to -1 (mod F(n)).
5 was the base originally used by Pepin. The base 10 gives the same results.
Any positive integer k for which the Jacobi symbol (k|F(n)) is -1 can be used as the base instead.
REFERENCES
M. Krizek, F. Luca & L. Somer, 17 Lectures on Fermat Numbers, Springer-Verlag NY 2001, pp. 42-43.
LINKS
Dennis Martin, Table of n, a(n) for n = 0..11
Chris Caldwell, The Prime Pages: Pepin's Test.
FORMULA
a(n) = 5^((F(n) - 1)/2) (mod F(n)), where F(n) is the n-th Fermat Number
EXAMPLE
a(4) = 5^(32768) (mod 65537) = 65536 = -1 (mod F(4)), therefore F(4) is prime.
a(5) = 5^(2147483648) (mod 4294967297) = -810129131 (mod F(5)), therefore F(5) is composite.
CROSSREFS
KEYWORD
sign
AUTHOR
Dennis Martin (dennis.martin(AT)dptechnology.com), Nov 27 2008
STATUS
approved