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-10 of 78 results. Next

A214757 a(n) = smallest Ramanujan prime R_k in A104272 that is >= A000101(n).

Original entry on oeis.org

11, 11, 11, 29, 97, 127, 569, 937, 1151, 1367, 9613, 15727, 19681, 31481, 156007, 360769, 370387, 492251, 1349669, 1357333, 2010881, 4652507, 17051981, 20831639, 47326913, 122165059, 189695893, 191913047
Offset: 1

Views

Author

John W. Nicholson, Jul 27 2012

Keywords

Comments

While many values in a(n) are equal to A000101(n), for A214756 it seems the only value such that A002386(n) is equal to A214756(n) is A214756(1) = R_k = A002386(1) = 2.
See "Let rho(m) = A179196(m)" comment at A001223.

Examples

			A104272(95) = R_k = 1367 > 1361 = A000101(10), so a(10) = 1367.
		

Crossrefs

Extensions

Edited by N. J. A. Sloane, Aug 06 2012
a(16)-a(28) from Donovan Johnson, Nov 04 2012

A107578 Prime index of A000101(n), maximal gap upper end prime index.

Original entry on oeis.org

2, 3, 5, 10, 25, 31, 100, 155, 190, 218, 1184, 1832, 2226, 3386, 14358, 30803, 31546, 40934, 103521, 104072, 149690, 325853, 1094422, 1319946, 2850175, 6957877, 10539433, 10655463, 20684333, 23163299, 64955635, 72507381
Offset: 1

Views

Author

Alex Beveridge, Apr 25 2007

Keywords

Comments

Conjecture: log a(n) ~ n/2. That is, record prime gaps occur about twice as often as records in an i.i.d. random sequence of comparable length (see arXiv:1709.05508 for a heuristic explanation). - Alexei Kourbatov, Jan 18 2019

Examples

			The prime index of a(3) = 5, so prime(a(3)) = prime(5) = 11.
		

Crossrefs

Formula

a(n) = A005669(n)+1. - Jens Kruse Andersen, Oct 19 2010
From John W. Nicholson, Oct 29 2021: (Start)
a(n) = A000720(A000101(n)).
a(n) = A000720(A002386(n)) + 1. (End)

Extensions

Name modified by John W. Nicholson, Nov 19 2013

A354604 Midpoints of record gaps between primes: a(n) = (A000101(n) + A002386(n))/2 for n > 1.

Original entry on oeis.org

4, 9, 26, 93, 120, 532, 897, 1140, 1344, 9569, 15705, 19635, 31433, 155964, 360701, 370317, 492170, 1349592, 1357267, 2010807, 4652430, 17051797, 20831428, 47326803, 122164858, 189695776, 191912907, 387096258, 436273150, 1294268635, 1453168287, 2300942709, 3842610941, 4302407536, 10726904850, 20678048489, 22367085156, 25056082315, 42652618575
Offset: 2

Views

Author

Donghwi Park, Jul 08 2022

Keywords

Comments

In the displayed portion of the sequence, the only numbers of least prime signature (A025487) are 4 and 120. This is noteworthy because numbers of least prime signature frequently are adjacent to primes (see A344385). It appears to be far more rare for a number of least prime signature to be at the center of a maximal prime gap. With 4 being a term in A344385, 120 seems to have a unique status. - Hal M. Switkay, Mar 13 2025

Crossrefs

Subsequence of A024675.

A350582 Decimal expansion of sum of reciprocals of maximal prime gap primes: Sum_{n>=1} 1/A000101(n).

Original entry on oeis.org

6, 8, 1, 7, 2, 9, 7, 9, 4, 9, 1, 3, 3, 8, 8, 7, 1
Offset: 0

Views

Author

John W. Nicholson, Jan 07 2022

Keywords

Examples

			0.68172979491338871...
		

Crossrefs

Programs

  • PARI
    v = readvec("b000101.txt");s=0; for(i=1,#v,s= 1/v[i]+s);s*1.
    \\ PARI's "readvec" doesn't work with the 2-column original OEIS b-file "b000101.txt". One needs to strip the index column first from b-file.

Extensions

a(15)-a(17) from John W. Nicholson, Feb 25 2025

A002386 Primes (lower end) with record gaps to the next consecutive prime: primes p(k) where p(k+1) - p(k) exceeds p(j+1) - p(j) for all j < k.

Original entry on oeis.org

2, 3, 7, 23, 89, 113, 523, 887, 1129, 1327, 9551, 15683, 19609, 31397, 155921, 360653, 370261, 492113, 1349533, 1357201, 2010733, 4652353, 17051707, 20831323, 47326693, 122164747, 189695659, 191912783, 387096133, 436273009, 1294268491
Offset: 1

Views

Author

Keywords

Comments

See the links by Jens Kruse Andersen et al. for very large gaps.

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, Sect 6.1, Table 1.
  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 14.
  • 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

Cf. A000040, A001223, A000101 (upper ends), A005250 (record gaps), A000230, A111870, A111943.
See also A205827(n) = A000040(A214935(n)), A182514(n) = A000040(A241540(n)).

Programs

  • Mathematica
    s = {2}; gm = 1; Do[p = Prime[n]; g = Prime[n + 1] - p; If[g > gm, Print[p]; AppendTo[s, p]; gm = g], {n, 2, 1000000}]; s   (* Jean-François Alcover, Mar 31 2011 *)
    Module[{nn=10^7,pr,df},pr=Prime[Range[nn]];df=Differences[pr];DeleteDuplicates[ Thread[ {Most[ pr],df}],GreaterEqual[#1[[2]],#2[[2]]]&]][[All,1]] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, Sep 24 2022 *)
  • PARI
    a(n)=local(p,g);if(n<2,2*(n>0),p=a(n-1);g=nextprime(p+1)-p;while(p=nextprime(p+1),if(nextprime(p+1)-p>g,break));p) /* Michael Somos, Feb 07 2004 */
    
  • PARI
    p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p && print1(q-g=q-p,","),) \\ M. F. Hasler, Dec 13 2007

Formula

a(n) = A000101(n) - A005250(n) = A008950(n-1) - 1. - M. F. Hasler, Dec 13 2007
A000720(a(n)) = A005669(n).
a(n) = A000040(A005669(n)). - M. F. Hasler, Apr 26 2014

Extensions

Definition clarified by Harvey P. Dale, Sep 24 2022

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

A005250 Record gaps between primes.

Original entry on oeis.org

1, 2, 4, 6, 8, 14, 18, 20, 22, 34, 36, 44, 52, 72, 86, 96, 112, 114, 118, 132, 148, 154, 180, 210, 220, 222, 234, 248, 250, 282, 288, 292, 320, 336, 354, 382, 384, 394, 456, 464, 468, 474, 486, 490, 500, 514, 516, 532, 534, 540, 582, 588, 602, 652
Offset: 1

Views

Author

N. J. A. Sloane, R. K. Guy, May 20 1991

Keywords

Comments

Here a "gap" means prime(n+1) - prime(n), but in other references it can mean prime(n+1) - prime(n) - 1.
a(n+1)/a(n) <= 2, for all n <= 80, and a(n+1)/a(n) < 1 + f(n)/a(n) with f(n)/a(n) <= epsilon for some function f(n) and with 0 < epsilon <= 1. It also appears, with the small amount of data available, for all n <= 80, that a(n+1)/a(n) ~ 1. - John W. Nicholson, Jun 08 2014, updated Aug 05 2019
Equivalent to the above statement, A053695(n) = a(n+1) - a(n) <= a(n). - John W. Nicholson, Jan 20 2016
Conjecture: a(n) = O(n^2); specifically, a(n) <= n^2. - Alexei Kourbatov, Aug 05 2017
Conjecture: below the k-th prime, the number of maximal gaps is about 2*log(k), i.e., about twice as many as the expected number of records in a sequence of k i.i.d. random variables (see arXiv:1709.05508 for a heuristic explanation). - Alexei Kourbatov, Mar 16 2018

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
  • R. K. Guy, Unsolved Problems in Number Theory, A8.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Records in A001223. For positions of records see A005669.

Programs

  • Haskell
    a005250 n = a005250_list !! (n-1)
    a005250_list = f 0 a001223_list
       where f m (x:xs) = if x <= m then f m xs else x : f x xs
    -- Reinhard Zumkeller, Dec 12 2012
  • Mathematica
    nn=10^7;Module[{d=Differences[Prime[Range[nn]]],ls={1}},Table[If[d[[n]]> Last[ls],AppendTo[ls,d[[n]]]],{n,nn-1}];ls] (* Harvey P. Dale, Jul 23 2012 *)
    DeleteDuplicates[Differences[Prime[Range[10^7]]],GreaterEqual] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, May 12 2022 *)
  • PARI
    p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p & print1(g=q-p,","),) \\ M. F. Hasler, Dec 13 2007
    
  • PARI
    p=2; g=0;m=g; forprime(q=3,10^13,g=q-p;if(g>m,print(g", ",p,", ",q);m=g);p=q) \\ John W. Nicholson, Dec 18 2016
    

Formula

a(n) = A000101(n) - A002386(n) = A008996(n-1) + 1. - M. F. Hasler, Dec 13 2007
a(n+1) = 1 + Sum_{i=1..n} A053695(i). - John W. Nicholson, Jan 20 2016

Extensions

More terms from Andreas Boerner (andreas.boerner(AT)altavista.net), Jul 11 2000
Additional comments from Frank Ellermann, Apr 20 2001
More terms from Robert G. Wilson v, Jan 03 2002, May 01 2006

A007508 Number of twin prime pairs below 10^n.

Original entry on oeis.org

2, 8, 35, 205, 1224, 8169, 58980, 440312, 3424506, 27412679, 224376048, 1870585220, 15834664872, 135780321665, 1177209242304, 10304195697298, 90948839353159, 808675888577436
Offset: 1

Views

Author

Keywords

Comments

"At the present time (2001), Thomas Nicely has reached pi_2(3*10^15) and his value is confirmed by Pascal Sebah who made a new computation from scratch and up to pi_2(5*10^15) [ = 5357875276068] with an independent implementation."
Though the first paper contributed by D. A. Goldston was reported to be flawed, the more recent one (with other coauthors) maintains and substantiates the result. - Lekraj Beedassy, Aug 19 2005
Theorem. While g is even, g > 0, number of primes p < x (x is an integer) such that p' = p + g is also prime, could be written as qpg(x) = qcc(x) - (x - pi(x) - pi(x + g) + 1) where qcc(x) is the number of "common composite numbers" c <= x such that c and c' = c + g both are composite (see Example below; I propose it here as a theorem only not to repeat for so-called "cousin"-primes (p; p+4), "sexy"-primes (p; p+6), etc.). - Sergey Pavlov, Apr 08 2021

Examples

			For x = 10, qcc(x) = 4 (since 2 is prime; 4, 6, 8, 10 are even, and no odd 0 < d < 25 such that both d and d' = d + 2 are composite), pi(10) = 4, pi(10 + 2) = 5, but, while v = 2+2 or v = 2-2 would be even, we must add 1; hence, a(1) = qcc(10^1) - (10^1 - pi(10^1) - pi(10^1 + 2) + 1) = 4 - (10 - 4 - 5 + 1) = 2 (trivial). - _Sergey Pavlov_, Apr 08 2021
		

References

  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 202.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 195.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001097.
Cf. A173081 and A181678 (number of twin Ramanujan prime pairs below 10^n).

Programs

  • Mathematica
    ile = 2; Do[Do[If[(PrimeQ[2 n - 1]) && (PrimeQ[2 n + 1]), ile = ile + 1], {n, 5*10^m, 5*10^(m + 1)}]; Print[{m, ile}], {m, 0, 7}] (* Artur Jasinski, Oct 24 2011 *)
  • PARI
    a(n)=my(s,p=2);forprime(q=3,10^n,if(q-p==2,s++);p=q);s \\ Charles R Greathouse IV, Mar 21 2013

Formula

Partial sums of A070076(n). - Lekraj Beedassy, Jun 11 2004
For 1 < n < 19, a(n) ~ e * pi(10^n) / (5*n - 5) = e * A006880(n) / (5*n - 5) where e is Napier's constant, see A001113 (probably, so is for any n > 18; we use n > 1 to avoid division by zero). - Sergey Pavlov, Apr 07 2021
For any n, a(n) = qcc(x) - (10^n - pi(10^n) - pi(10^n + 2) + 1) where qcc(x) is the number of "common composite numbers" c <= 10^n such that c and c' = c + 2 both are composite (trivial). - Sergey Pavlov, Apr 08 2021

Extensions

pi2(10^15) due to Nicely and Szymanski, contributed by Eric W. Weisstein
pi2(10^16) due to Pascal Sebah, contributed by Robert G. Wilson v, Aug 22 2002
Added a(17)-a(18) computed by Tomás Oliveira e Silva and link to his web site. - M. F. Hasler, Dec 18 2008
Definition corrected by Max Alekseyev, Oct 25 2010
a(16) corrected by Dana Jacobsen, Mar 28 2014

A049711 a(n) = n - prevprime(n).

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6
Offset: 3

Views

Author

Keywords

Comments

All runs end in even numbers at a(p), new highs are found at A000101 and the increasing gap size is A005250. - Robert G. Wilson v, Dec 07 2001
All terms are positive since here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015

Crossrefs

Programs

  • Maple
    A049711 := n-> n-prevprime(n);
  • Mathematica
    PrevPrim[n_] := Block[ {k = n - 1}, While[ !PrimeQ[k], k-- ]; Return[k]]; Table[ n - PrevPrim[n], {n, 3, 100} ]
    Array[#-NextPrime[#,-1]&,100,3] (* Harvey P. Dale, Dec 07 2011 *)
  • PARI
    A049711(n)=n-precprime(n-1) \\ M. F. Hasler, Sep 09 2015

Formula

a(n) = A064722(n-1) + 1. - Pontus von Brömssen, Jul 31 2022

A005669 Indices of primes where largest gap occurs.

Original entry on oeis.org

1, 2, 4, 9, 24, 30, 99, 154, 189, 217, 1183, 1831, 2225, 3385, 14357, 30802, 31545, 40933, 103520, 104071, 149689, 325852, 1094421, 1319945, 2850174, 6957876, 10539432, 10655462, 20684332, 23163298, 64955634, 72507380, 112228683, 182837804, 203615628, 486570087
Offset: 1

Views

Author

Keywords

Comments

Conjecture: log a(n) ~ n/2. That is, record prime gaps occur about twice as often as records in an i.i.d. random sequence of comparable length (see arXiv:1709.05508 for a heuristic explanation). - Alexei Kourbatov, Mar 28 2018

References

  • H. Riesel, Prime numbers and computer methods for factorization, Progress in Mathematics, Vol. 57, Birkhäuser, Boston, 1985, Chap. 4, see pp. 381-384.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{d, i, m = 0}, Reap@ For[i = 1, i <= n, i++, d = Prime[i + 1] - Prime@ i; If[d > m, m = d; Sow@ i, False]] // Flatten // Rest]; f@ 1000000 (* Michael De Vlieger, Mar 24 2015 *)

Formula

a(n) = A000720(A002386(n)).
a(n) = A107578(n) - 1. - Jens Kruse Andersen, Oct 19 2010
Showing 1-10 of 78 results. Next