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-5 of 5 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

A182315 Primes prime(n) such that prime(n+1) - prime(n) > log(n)^2.

Original entry on oeis.org

2, 3, 5, 7, 13, 23, 31, 113, 1327, 31397, 370261, 492113, 2010733, 20831323, 25056082087, 42652618343, 2614941710599, 19581334192423
Offset: 1

Views

Author

Thomas Ordowski, Apr 24 2012

Keywords

Comments

Using terms of A002386, a(19) is probably 218209405436543. - T. D. Noe, Apr 24 2012

Crossrefs

Subsequence of A211073.

Programs

  • Mathematica
    t = {}; Do[If[Prime[n + 1] - Prime[n] > Log[n]^2, AppendTo[t, Prime[n]]], {n, 10000}]; t (* T. D. Noe, Apr 24 2012 *)
  • PARI
    n=0;G=1;p=2;forprime(q=3,1e8,n++;if(q-p>=G&&q-p>log(n)^2, G=ceil(log(n)^2);print1(p", "));p=q) \\ Charles R Greathouse IV, Apr 24 2012

Extensions

a(13)-a(16) from Charles R Greathouse IV, Apr 24 2012
a(17) from Charles R Greathouse IV, Apr 26 2012
a(18) from Charles R Greathouse IV, May 06 2012

A348178 The list of all prime numbers is split into sublists with the 1st sublist L_1 = {2} and n-th sublist L_n = {p_1, p_2, ..., p_m}. a(n) is the largest m such that the maximum prime gap in L_n is < p_1 - prevprime(p_1).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 2, 4, 1, 2, 3, 2, 1, 6, 32, 4, 33, 55, 35, 28, 842, 124, 349, 131, 168, 394, 585, 575, 10972, 14683, 1762, 743, 9388, 62587, 551, 14434, 31184, 176163, 407736, 249427, 111406, 225524, 1530229, 4107702, 3581556, 116030, 10028870, 2065372
Offset: 1

Views

Author

Ya-Ping Lu, Oct 05 2021

Keywords

Comments

The last prime in the n-th sublist is A134266(n). The gap between the n-th and (n+1)-th sublists is A085237(n).

Crossrefs

Programs

  • Python
    from sympy import nextprime
    L = [2]
    for n in range(1, 50):
        print(len(L), end = ', ')
        p0 = L[-1]; p1 = nextprime(p0); g0 = p1 - p0; M = [p1]; p = nextprime(p1)
        while p - p1 < g0: M.append(p); p1 = p; p = nextprime(p)
        L = M

A085500 Indices of primes where nondecreasing gaps occur.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 11, 15, 16, 18, 21, 23, 24, 30, 62, 66, 99, 154, 189, 217, 1059, 1183, 1532, 1663, 1831, 2225, 2810, 3385, 14357, 29040, 30802, 31545, 40933, 103520, 104071, 118505, 149689, 325852, 733588, 983015, 1094421, 1319945, 2850174, 6957876, 10539432, 10655462
Offset: 1

Views

Author

Farideh Firoozbakht, Aug 15 2003

Keywords

Comments

A005669 is a subsequence of this sequence.

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section A8, pp. 31-39.

Crossrefs

Programs

  • Mathematica
    f[n_] := Prime[n+1]-Prime[n]; v1={}; v2={}; Do[If[f[n]>=If[n==1, 1, Last[v2]], v=n; v1=Append[v1, n]; v2=Append[v2, f[v]]; Print[v1]], {n, 105000000}]

Formula

a(n) = A000720(A134266(n)). - M. F. Hasler, Apr 26 2014

Extensions

a(45)-a(47) from Amiram Eldar, Sep 05 2024

A361823 a(1) = 3; thereafter, a(n+1) is the smallest prime p such that p - prevprime(p) >= a(n) - prevprime(a(n)).

Original entry on oeis.org

3, 5, 7, 11, 17, 23, 29, 37, 53, 59, 67, 79, 89, 97, 127, 307, 331, 541, 907, 1151, 1361, 8501, 9587, 12889, 14143, 15727, 19661, 25523, 31469, 156007, 338119, 360749, 370373, 492227, 1349651, 1357333, 1562051, 2010881, 4652507, 11114087, 15204131, 17051887
Offset: 1

Views

Author

Ya-Ping Lu, Mar 25 2023

Keywords

Comments

a(n) is the leading prime in the (n+1)-th prime sublist defined in A348178.

Crossrefs

Programs

  • PARI
    a361823(upto) = {my(pp=2, gap=1); forprime (p=3, upto, my(g=p-pp);if(g>=gap, print1(p,", "); gap=g); pp=p)};
    a361823(20000000) \\ Hugo Pfoertner, Apr 03 2023
  • Python
    from sympy import nextprime; q = 2; g = 0
    while q < 20000000:
        p = nextprime(q); d = p - q
        if d >= g: print(p, end = ', '); g = d
        q = p
    

Formula

a(n) = nextprime(A134266(n)). - Michel Marcus, Mar 30 2023
Showing 1-5 of 5 results.