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-7 of 7 results.

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

A000101 Record gaps between primes (upper end) (compare A002386, which gives lower ends of these gaps).

Original entry on oeis.org

3, 5, 11, 29, 97, 127, 541, 907, 1151, 1361, 9587, 15727, 19661, 31469, 156007, 360749, 370373, 492227, 1349651, 1357333, 2010881, 4652507, 17051887, 20831533, 47326913, 122164969, 189695893, 191913031, 387096383, 436273291, 1294268779
Offset: 1

Views

Author

Keywords

Comments

See A002386 for complete list of known terms and further references.
Except for a(1)=3 and a(2)=5, a(n) = A168421(k). Primes 3 and 5 are special in that they are the only primes which do not have a Ramanujan prime between them and their double, <= 6 and 10 respectively. Because of the large size of a gap, there are many repeats of the prime number in A168421. - John W. Nicholson, Dec 10 2013

References

  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 133.
  • 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 (differences between primes), A002386 (lower ends), A005250 (record gaps), A107578.
Cf. also A005669, A111943.

Programs

  • Mathematica
    s = {3}; gm = 1; Do[p = Prime[n + 1]; g = p - Prime[n]; If[g > gm, Print[p]; AppendTo[s, p]; gm = g], {n, 2, 1000000}]; s  (* Jean-François Alcover, Mar 31 2011 *)
  • PARI
    p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p & print1(p+g=q-p,","),) \\ M. F. Hasler, Dec 13 2007

Formula

a(n) = A002386(n) + A005250(n) = A008995(n-1) + 1. - M. F. Hasler, Dec 13 2007

A111870 Prime p with prime gap q - p of n-th record merit, where q is smallest prime larger than p and the merit of a prime gap is (q-p)/log(p).

Original entry on oeis.org

2, 3, 7, 113, 1129, 1327, 19609, 31397, 155921, 360653, 370261, 1357201, 2010733, 17051707, 20831323, 191912783, 436273009, 2300942549, 3842610773, 4302407359, 10726904659, 25056082087, 304599508537, 461690510011, 1346294310749, 1408695493609, 1968188556461, 2614941710599, 13829048559701, 19581334192423, 218209405436543, 1693182318746371
Offset: 1

Views

Author

N. J. A. Sloane, based on correspondence with Ed Pegg Jr, Nov 23 2005

Keywords

Comments

As I understand it, the sequence refers to "Smallest prime p whose following gap has bigger merit than the other primes smaller than p." If that is the case, then it has an error. The sequence starts: 2, 3, 7, 113, 1129, 1327, 19609, 31397, 155921, 360653, 370261, 1357201, 4652353, 2010733, ... but you can see that 4652353 > 2010733, so in any case it should be listed after, not before it. But above that, its merit is 10.03 < 10.20, the merit of 2010733, so it is not in a mistaken position: it shouldn't appear in the sequence. - Jose Brox, Dec 31 2005
The logarithmic (base 10) graph seems to be linearly asymptotic to n with slope ~ 1/log(10) which would imply that: log(prime with n-th record merit) ~ n as n goes to infinity. - N. J. A. Sloane, Aug 27 2010
The sequence b(n) = (prime(n+1)/prime(n))^n is increasing for terms prime(n) of this sequence. - Thomas Ordowski, May 04 2012
The smallest prime(n) such that (prime(n+1)/prime(n))^n is increasing: 2, 3, 7, 23, 113, 1129, 1327, ... (A205827). - Thomas Ordowski, May 04 2012
(prime(n+1)/prime(n))^n > 1 + merit(n) for n > 2, where merit(n) = (prime(n+1)-prime(n))/log(prime(n)). - Thomas Ordowski, May 14 2012
Merit(1) + merit(2) + ... + merit(n) =: S(n) ~ n, where merit(n) is as above. - Thomas Ordowski, Aug 03 2012
For the index of a(n), see the comment at A214935. - John W. Nicholson, Nov 21 2013

Examples

			The first few entries correspond to the following gaps. The table gives n, p, gap = q-p and the merit of the gap.
   1,       2,   1, 1.4427
   2,       3,   2, 1.82048
   3,       7,   4, 2.05559
   4,     113,  14, 2.96147
   5,    1129,  22, 3.12985
   6,    1327,  34, 4.72835
   7,   19609,  52, 5.26116
   8,   31397,  72, 6.95352
   9,  155921,  86, 7.19238
  10,  360653,  96, 7.50254
  11,  370261, 112, 8.73501
  12, 1357201, 132, 9.34782
		

References

  • Ed Pegg, Jr., Posting to Seq Fan mailing list, Nov 23 2005

Crossrefs

For the gaps, see A111871.

Programs

  • Mathematica
    With[{s = Map[(#2 - #1)/Log[#1] & @@ # &, Partition[Prime@ Range[10^6], 2, 1]]}, Map[Prime@ FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* Michael De Vlieger, Jul 19 2018 *)

Formula

a(n) = A277552(n) - A111871(n). - Bobby Jacobs, Nov 13 2016

Extensions

Corrected by Jose Brox, Dec 31 2005
Corrected and edited by Daniel Forgues, Oct 23 2009
Further edited by Daniel Forgues, Nov 01 2009, Nov 13 2009, Nov 24 2009

A166363 Number of primes in the half-open interval (n*(log(n))^2..(n+1)*(log(n+1))^2].

Original entry on oeis.org

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

Views

Author

Daniel Forgues, Oct 12 2009

Keywords

Comments

The open-closed half-open intervals form a partition of the real line for x > 0, thus each prime appears in a unique interval.
The n-th interval length is ~ (log(n+1/2))^2 + 2*log(n+1/2) ~ (log(n))^2 as n goes to infinity.
The n-th interval prime density is ~ 1/[log(n+1/2)+2*log(log(n+1/2))] ~ 1/log(n) as n goes to infinity.
The expected number of primes in the n-th interval is ~ [(log(n+1/2))^2 + 2*log(n+1/2)] / [log(n+1/2)+2*log(log(n+1/2))] ~ log(n) as n goes to infinity.
For n = 1 there is no prime.
If it can be proved that each interval always contains at least one prime, this would constitute even shorter intervals than A166332(n), let alone A143898(n), as n gets large.
The Shanks Conjecture and the Cramer-Granville Conjecture tell us that the intervals of length (log(n))^2 are of very critical length (the constant M > 1 of the Cramer-Granville Conjecture definitely matters!). There seems to be some risk that one such interval does not contain a prime.
The Wolf Conjecture (which agrees better with numerical evidence) seems more in favor of each interval's containing at least one prime.
From Charles R Greathouse IV, May 13 2010: (Start)
Not all intervals > 1 contain primes!
a(n) = 0 for n = 1, 4977, 17512, 147127, 76082969 (and no others up to 10^8).
Higher values include 731197850, 2961721173, 2103052050563, 188781483769833, 1183136231564246 but this list is not exhaustive.
The intervals have length (log n)^2 + 2*log n + o(1). In the Cramer model, the probability that a given integer in the interval would be prime is approximately 1/(log n + 2*log log n). Tedious calculation gives the probability that a(n) = 0 in the Cramer model as 3C(log n)^2/n * (1 + o(1)) with C = exp(-5/2)/3. Thus under that model we would expect to find roughly C*(log N)^3 numbers n up to N with a(n) = 0. In fact, the numbers are not that common since the probabilities are not independent.
(End)
The similar sequence A345755 relies on intervals that are slightly more than twice as wide as those in the present sequence. A345755 does not include zero entries for n <= 2772, suggesting that the lengths of prime gaps may be bracketed by the two sequences. We conjecture that prime gaps may be larger than log(p)^2, but are not larger than log_2(p)^2. - Hal M. Switkay, Aug 29 2023

Crossrefs

Cf. A166332, A000720, A111943, A143898, A134034, A143935, A144140 (primes between successive n^K, for different K), A014085 (primes between successive squares).

Programs

Formula

a(n) = pi((n+1)*(log(n+1))^2) - pi(n*(log(n))^2) since the intervals are half-open properly.

Extensions

Edited by Daniel Forgues, Oct 18 2009 and Nov 01 2009
Edited by Charles R Greathouse IV, May 13 2010

A211073 Primes p followed by a gap of at least 1/2 * log(p)^2.

Original entry on oeis.org

2, 3, 5, 7, 13, 23, 31, 113, 1327, 19609, 25471, 31397, 34061, 43331, 44293, 155921, 188029, 212701, 265621, 338033, 360653, 370261, 396733, 404851, 492113, 544279, 576791, 604073, 838249, 860143, 1098847, 1139993, 1313467, 1349533, 1357201, 1388483, 1444309
Offset: 1

Views

Author

Keywords

Comments

Primes followed by unusually long prime gaps.
The Cramér model suggests that there are about 2*sqrt(x/log^2 x) elements up to x. - Charles R Greathouse IV, Mar 18 2016

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[10^4]], NextPrime[#] - # > (Log[#]^2)/2 &] (* Alonso del Arte, Jun 02 2013 *)
  • PARI
    G=1; p=2; forprime(q=3, 1e7, if(q-p>=G && q-p>log(p)^2/2, G=ceil(log(p)^2/2); print1(p", ")); p=q)

Formula

Primes p such that all integers in (p, p + 0.5 * log(p)^2) are composite.

A241540 Indices of primes p in A182514, i.e., a(n) = primepi(p) = A000720(A182514(n)).

Original entry on oeis.org

1, 2, 4, 30, 217, 49749629143526
Offset: 1

Views

Author

M. F. Hasler, Apr 25 2014

Keywords

Comments

a(6) = A214935(33) = A000720(A205827(33)).

Crossrefs

A211075 Primes p followed by prime gap of length log(p/log(p)^2)^2.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 103, 109, 113, 127, 131, 139, 151, 157, 163, 167, 173, 181, 193, 199, 211, 233, 241, 251, 257, 263, 271, 283, 293, 317, 331, 337, 353, 359, 367, 373, 383, 389, 401, 409
Offset: 1

Views

Author

Keywords

Comments

Primes followed by unusually long prime gaps.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]], NextPrime[#] - # > Log[#/Log[#]^2]^2 &] (* Alonso del Arte, Jun 02 2013 *)
  • PARI
    G=1;p=3;forprime(q=5,1e7,if(q-p>=G,G=log(p/log(p)^2)^2; if(q-p>=G, print1(p", ")));p=q)
Showing 1-7 of 7 results.