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.

A144309 a(n) is the index of the smallest prime such that the gap to the next prime is not less than 2*n.

Original entry on oeis.org

2, 4, 9, 24, 30, 30, 30, 99, 99, 154, 189, 217, 217, 217, 217, 217, 217, 1183, 1831, 1831, 1831, 1831, 2225, 2225, 2225, 2225, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 14357, 14357, 14357, 14357, 14357, 14357, 14357, 30802, 30802, 30802
Offset: 1

Views

Author

Artur Jasinski, Sep 17 2008

Keywords

Crossrefs

For indices of smallest prime such that gap to next prime is exactly equal to 2*n see A000230. For records in this sequence see A005669.

Programs

  • Mathematica
    a = {}; Do[n = 1; While[(Prime[n + 1] - Prime[n]) < 2 k, n++ ]; AppendTo[a, n], {k, 1, 75}]; a
  • PARI
    lista(pmax) = {my(k = 1, prv = 2, m = 2, kprv = 2); forprime(p = 3, pmax, k++; if(p - prv >= m, for(i = 1, (p - prv - m)/2 + 1, print1(k-1, ", ")); m = p - prv + 2; kprv = k); prv = p);} \\ Amiram Eldar, Sep 06 2024

Formula

a(n) = primepi(A100964(n)) = A000720(A100964(n)). - Michel Marcus, Nov 02 2013