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

A038460 Maximal value of difference between successive primes among numbers < 10^n.

Original entry on oeis.org

2, 8, 20, 36, 72, 114, 154, 220, 282, 354, 464, 540, 674, 804, 906, 1132, 1220, 1442, 1510
Offset: 1

Views

Author

Enoch Haga, Dec 11 1999

Keywords

Comments

All terms are even, and the sequence is strictly increasing, and therefore also yields the maximal gap between n-digit primes (unless a gap containing 10^k would be larger than all gaps up to 10^(k+1), which does not happen). Therefore also a subsequence of A005250, which is a subsequence of A001223. - M. F. Hasler, Dec 29 2014
For 3 < n < 19, a(n) <= 6 (n - 1)(n - 2). Conjecture: for any n > 3, a(n) <= 6 (n - 1)(n - 2). Let q = 6 (n - 1)(n - 2) and d = (10^n) - (10^(n/2) - 1)^2. Since for any even n, d is the smallest difference between two consecutive squares of the form a^2 - b^2, where a^2 = 10^n, b = a - 1, for any even n > 2, d > 5q (where 3q is, according to the conjecture, not less than the sum of the three largest gaps between 4 consecutive primes p1...p4, or 3 * a(n), and 2q is, respectively, not less than the sum of the two largest gaps (p1 - p0) + (p5 - p4), or 2 * a(n)). In the same way, we can state that for any odd n > 3, if a^2 is the smallest square such that a^2 has (n+1) digits, b = a - 1, and d = a^2 - b^2, then d > 5q. The correctness of the above conjecture would establish the well-known Brocard's and Legendre's conjectures (see the link below for both definitions), since they are proved for the first 10000 primes. - Sergey Pavlov, Jan 30 2017

Examples

			Of the 25 primes less than 100, the maximum difference between two consecutive primes is 8 (at 97 - 89), so a(2)=8.
		

References

  • Enoch Haga, Exploring Prime Numbers on Your PC, 2nd edition, 1998, ISBN 1-885794-16-9, Table 3.

Crossrefs

Cf. A038343. See A053303 for another version.

Programs

  • Mathematica
    a[1] = 2; a[n_] := a[n] = Module[{m, p, q}, m = a[n-1]; p = NextPrime[10^(n - 1), -1]; For[q = NextPrime[p], q < 10^n, q = NextPrime[q], m = Max[m, q - p]; p = q]; m]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 10}] (* Jean-François Alcover, May 16 2017 *)
    Table[Differences[Prime[Range[PrimePi[10^n]]]]//Max,{n,10}] (* The program generates the first 10 terms of the sequence. *) (* Harvey P. Dale, Sep 11 2024 *)
  • PARI
    a(n) = {dmax = 0; minp = 2; forprime(p=3, 10^n, if ((d = (p - minp)) > dmax, dmax = d); minp = p;); dmax;} \\ Michel Marcus, May 25 2014
    
  • PARI
    m=0;L=1;o=2;forprime(p=3,10^9,m+o>=(o=p)&&next;#Str(p)>L&&!print1(m" /*"L"*/, ")&&L=#Str(p);m=p-precprime(p-1)) \\ Too slow for n>9. M. F. Hasler, Dec 29 2014

Extensions

Two more terms (282, 354) from Jud McCranie
Terms 464 through 1442 from Manfred W. K. Huppertz (huppi-manni(AT)hesit.de), Aug 18 2009
a(19) from Hugo Pfoertner, using data from pzktupel webpage. Jan 21 2025

A053302 Largest n-digit prime at the start of a record in the RECORDS transform of the prime gaps.

Original entry on oeis.org

7, 89, 887, 9551, 31397, 492113, 4652353, 47326693, 436273009, 4302407359, 42652618343, 738832927927, 7177162611713, 90874329411493, 218209405436543, 1693182318746371
Offset: 1

Views

Author

Enoch Haga, Mar 05 2000

Keywords

Comments

a(17) is probably 80873624627234849 and a(19) is probably 8822016561303449927. - Robert G. Wilson v, Mar 16 2004
a(18) is most probably 804212830686677669. - M. F. Hasler, Apr 25 2014
Is this a duplicate of A073861 (except for the first term)? - M. F. Hasler, Apr 25 2014

Examples

			a(5)=31397, the last 5-digit prime to begin a gap.
		

Crossrefs

The length of the gap is in A053303.

Formula

a(n) = { max p: p in A002386; p< 10^n}. - R. J. Mathar, Feb 01 2008

Extensions

Corrected by Jud McCranie, Jan 03 2001
a(15) and a(16) from Robert G. Wilson v, Mar 16 2004
Edited by R. J. Mathar, Feb 01 2008

A123386 Largest difference between successive semiprimes up to 10^n inclusive.

Original entry on oeis.org

3, 7, 14, 24, 38, 47, 74, 74, 95, 112, 146, 163, 174
Offset: 1

Views

Author

Alexander Adamchuk, Nov 09 2006

Keywords

Comments

There are 4 semiprimes up to 10^1 {4, 6, 9, 10}. The differences between successive semiprimes are {2, 3, 1}. Thus a(1) = Max[ {2, 3, 1} ] = 3.

Crossrefs

Programs

  • PARI
    A001358(prev)={ local(a=prev+1) ; while(bigomega(a)!=2, a++ ; ) ; return(a) ; }
    A123386(n)={ local(sp1=4,sp2=6,a=2) ; while(sp2<=10^n, a=max(a,sp2-sp1) ; sp1=sp2 ; sp2=A001358(sp1) ; ) ; return(a) ; }
    { for(n=1,13, print(A123386(n)) ; ) ; } \\ 2 more terms from R. J. Mathar, Jan 17 2008

Extensions

2 more term from R. J. Mathar, Jan 17 2008
a(8)-a(9) from Donovan Johnson, Sep 05 2008
a(10)-a(11) from Donovan Johnson, Apr 14 2010
a(12)-a(13) from Donovan Johnson, Sep 20 2012

A286894 a(n) = maximum difference between two consecutive primes up to 2^n.

Original entry on oeis.org

0, 1, 2, 4, 6, 6, 14, 14, 14, 20, 34, 34, 34, 44, 72, 72, 72, 86, 114, 114, 148, 148, 154, 154, 210, 220, 222, 248, 282, 282, 292, 336, 354, 382, 456, 464, 468, 486, 532, 540, 602, 652, 674, 716, 766, 778, 804, 906, 906, 906
Offset: 1

Views

Author

Jean-François Alcover, May 15 2017

Keywords

Examples

			Up to 2^5 = 32, the maximum difference between two consecutive primes is 6 (at 29 - 23), so a(5)=6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 0, Prime[Range[PrimePi[NextPrime[2^n, -1]]]] // Differences // Max]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 30}]
  • PARI
    a(n) = {maxg = 0; p = 2; forprime(q=3, 2^n, maxg = max(maxg, q-p); p=q;); maxg;} \\ Michel Marcus, May 15 2017

Extensions

a(33)-a(50) from David A. Corneth, May 16 2017
Showing 1-4 of 4 results.