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.

Showing 1-3 of 3 results.

A000230 a(0)=2; for n>=1, a(n) = smallest prime p such that there is a gap of exactly 2n between p and next prime, or -1 if no such prime exists.

Original entry on oeis.org

2, 3, 7, 23, 89, 139, 199, 113, 1831, 523, 887, 1129, 1669, 2477, 2971, 4297, 5591, 1327, 9551, 30593, 19333, 16141, 15683, 81463, 28229, 31907, 19609, 35617, 82073, 44293, 43331, 34061, 89689, 162143, 134513, 173359, 31397, 404597, 212701, 188029, 542603, 265621, 461717, 155921, 544279, 404851, 927869, 1100977, 360653, 604073
Offset: 0

Views

Author

Keywords

Comments

p + 1 = A045881(n) starts the smallest run of exactly 2n-1 successive composite numbers. - Lekraj Beedassy, Apr 23 2010
Weintraub gives upper bounds on a(252), a(255), a(264), a(273), and a(327) based on a search from 1.1 * 10^16 to 1.1 * 10^16 + 1.5 * 10^9, probably performed on a 1970s microcomputer. - Charles R Greathouse IV, Aug 26 2022

Examples

			The following table, based on a very much larger table in the web page of Tomás Oliveira e Silva (see link) shows, for each gap g, P(g) = the smallest prime such that P(g)+g is the smallest prime number larger than P(g);
* marks a record-holder: g is a record-holder if P(g') > P(g) for all (even) g' > g, i.e., if all prime gaps are smaller than g for all primes smaller than P(g); P(g) is a record-holder if P(g') < P(g) for all (even) g' < g.
This table gives rise to many sequences: P(g) is A000230, the present sequence; P(g)* is A133430; the positions of the *'s in the P(g) column give A100180, A133430; g* is A005250; P(g*) is A002386; etc.
   -----
   g P(g)
   -----
   1* 2*
   2* 3*
   4* 7*
   6* 23*
   8* 89*
   10 139*
   12 199*
   14* 113
   16 1831*
   18* 523
   20* 887
   22* 1129
   24 1669
   26 2477*
   28 2971*
   30 4297*
   32 5591*
   34* 1327
   36* 9551*
   ........
The first time a gap of 4 occurs between primes is between 7 and 11, so a(2)=7 and A001632(2)=11.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A001632(n) = 2n + a(n) = nextprime(a(n)).
Cf. A100964 (least prime number that begins a prime gap of at least 2n).

Programs

Formula

a(n) = A000040(A038664(n)). - Lekraj Beedassy, Sep 09 2006

Extensions

a(29)-a(37) from Jud McCranie, Dec 11 1999
a(38)-a(49) from Robert A. Stump (bee_ess107(AT)yahoo.com), Jan 11 2002
"or -1 if ..." added to definition at the suggestion of Alexander Wajnberg by N. J. A. Sloane, Feb 02 2020

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

A100965 Smallest prime number that ends a prime gap of at least 2n.

Original entry on oeis.org

5, 11, 29, 97, 127, 127, 127, 541, 541, 907, 1151, 1361, 1361, 1361, 1361, 1361, 1361, 9587, 15727, 15727, 15727, 15727, 19661, 19661, 19661, 19661, 31469, 31469, 31469, 31469, 31469, 31469, 31469, 31469, 31469, 31469, 156007, 156007, 156007, 156007
Offset: 1

Views

Author

T. D. Noe, Nov 23 2004

Keywords

Comments

The second Mathematica program below generates the first 40 terms of the sequence given a value for nn of 15000. To generate the first 50 terms of the sequence the value of nn needs to be increased to about 32000. If a given value of nn is too low for the number of terms desired, this problem will be signaled by one or more of the generated terms being "NotFound" in which case increasing the value of nn appropriately should permit generating the desired number of terms. - Harvey P. Dale, Jul 10 2018

Examples

			a(5)=a(6)=a(7)=127 because there is a gap of 14 between 113 and 127.
		

Crossrefs

Cf. A100964.

Programs

  • Mathematica
    k=1; Table[While[Prime[k+1]-Prime[k] < 2n, k++ ]; Prime[k+1], {n, 48}]
    Module[{nn=15000,pr,lst},pr=Prime[Range[2,nn]];lst=Thread[{pr,PadLeft[ Differences[ pr],nn-1]}];Table[SelectFirst[lst,#[[2]]>=2n&],{n,40}]][[All,1]] (* See Comment, above *) (* This program is several thousand times faster than the first program above *) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 08 2018 *)
Showing 1-3 of 3 results.