login
A286894
a(n) = maximum difference between two consecutive primes up to 2^n.
0
0, 1, 2, 4, 6, 6, 14, 14, 14, 20, 34, 34, 34, 44, 72, 72, 72, 86, 114, 114, 148, 148, 154, 154, 210, 220, 222, 248, 282, 282, 292, 336, 354, 382, 456, 464, 468, 486, 532, 540, 602, 652, 674, 716, 766, 778, 804, 906, 906, 906
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
Sequence in context: A123258 A278227 A104968 * A346911 A225187 A281485
KEYWORD
nonn,more
AUTHOR
EXTENSIONS
a(33)-a(50) from David A. Corneth, May 16 2017
STATUS
approved