OFFSET
1,5
COMMENTS
M_p is prime iff 3^(M_p-1) is congruent to 1 mod M_p. Thus M_7 = 127 is prime because 3^126 mod 127 = 1 while M_11 = 2047 is composite because 3^2046 mod 2047 <> 1.
LINKS
Dennis Martin, Table of n, a(n) for n = 1..100
FORMULA
a(n) = 3^(2^p(n)-2) mod 2^p(n)-1
EXAMPLE
a(5) = 3^(2^11-2) mod 2^11-1 = 3^2046 mod 2047 = 1013
CROSSREFS
KEYWORD
nonn
AUTHOR
Dennis Martin (dennis.martin(AT)dptechnology.com), Jul 20 2007
STATUS
approved