OFFSET
1,3
LINKS
Eric Weisstein's MathWorld, Prime Gaps
EXAMPLE
Up to 2^5 = 32, the maximum difference between two consecutive primes is 6 (at 29 - 23), so a(5)=6.
MATHEMATICA
a[n_] := If[n == 1, 0, Prime[Range[PrimePi[NextPrime[2^n, -1]]]] // Differences // Max]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 30}]
PROG
(PARI) a(n) = {maxg = 0; p = 2; forprime(q=3, 2^n, maxg = max(maxg, q-p); p=q; ); maxg; } \\ Michel Marcus, May 15 2017
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Jean-François Alcover, May 15 2017
EXTENSIONS
a(33)-a(50) from David A. Corneth, May 16 2017
STATUS
approved