OFFSET
0,1
COMMENTS
Since a(21) > 0, M(23) = 8388607 is composite. Mersenne numbers are only prime if a(p-2) = 0.
LINKS
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(21) = 6563009^2 - 2 mod 8388607 = 6107895.
CROSSREFS
KEYWORD
fini,full,nonn
AUTHOR
Sergio Pimentel, Apr 04 2007
STATUS
approved