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

A046728 Let p1, p2 be first pair of consecutive primes with difference 2n; let p3, p4 be 2nd such pair; sequence gives "wadi" value p3-p1.

Original entry on oeis.org

2, 6, 8, 270, 42, 12, 180, 102, 546, 750, 822, 510, 660, 300, 534, 5208, 7140, 3302, 7800, 1476, 18840, 20706, 9570, 44960, 13986, 5862, 4672, 71118, 14538, 59370, 156348, 17688, 59184, 155736, 1782, 328694, 110370, 119616, 93402, 76116
Offset: 1

Views

Author

Keywords

Examples

			First consecutive prime pair having difference 60 is p1=43331, p2=43391; next is p3=102701, p4=102761; so a(30)=102701-43331=59370.
		

References

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

Crossrefs

Cf. A038460, A038343. a(i)=b(i)-c(i) where b(i) is A046789 and c(i) is A000230.

Programs

  • Mathematica
    Flatten[Table[Differences[First /@ Take[Select[Partition[Prime[Range[60000]], 2, 1], Differences[#] == {2 n} &], 2]], {n, 40}]] (* Jayanta Basu, Jun 27 2013 *)
  • PARI
    a(n)=my(k,p=2,p1);forprime(q=3,,if(q-p==2*n,if(k++>1,return(p-p1),p1=p));p=q) \\ Charles R Greathouse IV, Jun 27 2013

Formula

a(n) = A046789(n) - A000230(n). - Robert G. Wilson v, Nov 26 2020

Extensions

More terms from Jud McCranie
a(31) inserted by Jayanta Basu, Jun 27 2013
Showing 1-2 of 2 results.