OFFSET
0,1
COMMENTS
Since a(27) > 0, M(29) = 536870911 is composite. Mersenne numbers are only prime if a(p-2) = 0.
LINKS
Dennis Martin, Table of n, a(n) for n = 0..27
Eric Weisstein's World of Mathematics, Lucas Lehmer Test.
Wikipedia, Lucas Lehmer Primality Test.
FORMULA
a(0) = 4, a(n) = a(n-1)^2 mod 2^p-1, last term: a(p-2).
EXAMPLE
a(27) = 365171774^2 - 2 mod 536870911 = 458738443.
CROSSREFS
KEYWORD
fini,nonn
AUTHOR
Sergio Pimentel, Apr 04 2007
STATUS
approved