OFFSET
0,6
COMMENTS
LINKS
C. K. Caldwell, The Prime Glossary, Fermat prime.
Eric Weisstein's World of Mathematics, Fermat Number.
Eric Weisstein's World of Mathematics, Fermat Prime.
MATHEMATICA
a[n_] := Module[{k = 0}, While[! PrimeQ[2^(2^n) + k], k++]; k]; Array[a, 12, 0] (* Amiram Eldar, Jun 11 2022 *)
PROG
(PARI) a(n)=if(n<0, 0, s=0; while(isprime(2^(2^n)+s)==0, s++); s)
(Python)
from sympy import nextprime
def a(n): m = 2**(2**n); return nextprime(m-1) - m
print([a(n) for n in range(12)]) # Michael S. Branicky, Jun 12 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Benoit Cloitre, May 18 2007
EXTENSIONS
More terms from T. D. Noe, Jul 19 2007
STATUS
approved