cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A286894 a(n) = maximum difference between two consecutive primes up to 2^n.

Original entry on oeis.org

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

Views

Author

Jean-François Alcover, May 15 2017

Keywords

Examples

			Up to 2^5 = 32, the maximum difference between two consecutive primes is 6 (at 29 - 23), so a(5)=6.
		

Crossrefs

Programs

  • 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}]
  • 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

Extensions

a(33)-a(50) from David A. Corneth, May 16 2017