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.

Previous Showing 11-20 of 53 results. Next

A080841 Number of pairs (p,q) of (not necessarily consecutive) primes with q-p = 6 and q < 10^n.

Original entry on oeis.org

0, 15, 74, 411, 2447, 16386, 117207, 879908, 6849047, 54818296, 448725003, 3741217498
Offset: 1

Views

Author

Jason Earls, Mar 28 2003

Keywords

Comments

Note that one has to be careful to distinguish between pairs of consecutive primes (p,q) with q-p = 6 (A031924), and pairs of primes (p,q) with q-p = 6 (A023201). Here we consider the latter, whereas A093738 considers the former. - N. J. A. Sloane, Mar 07 2021

Crossrefs

Programs

  • PARI
    {c=0; p=7; for(n=1,9, while(p<10^n,if(isprime(p-6),c++); p=nextprime(p+1)); print1(c,","))}

Extensions

a(8) and a(9) from Klaus Brockhaus, Mar 30 2003
More terms from R. J. Mathar, Aug 05 2007

A093737 Number of prime pairs below 10^n having a difference of 4.

Original entry on oeis.org

0, 7, 40, 202, 1215, 8143, 58621, 440257, 3424679, 27409998, 224373160, 1870585458, 15834656002, 135779962759, 1177207270203, 10304191320776, 90948823579814, 808675898548205
Offset: 1

Views

Author

Enoch Haga, Apr 15 2004

Keywords

Examples

			a(2) = 7 because there are 7 prime gaps of 4 below 10^2.
		

Crossrefs

Programs

  • PARI
    a(n)=my(p=2,s); forprime(q=3,10^n, if(q-p==4, s++); p=q); s \\ Charles R Greathouse IV, Feb 05 2016
  • UBASIC
    20 N=1:dim T(34); 30 A=nxtprm(N); 40 N=A; 50 B=nxtprm(N); 60 D=B-A; 70 for x=2 to 34 step 2; 80 if D=X and B<10^2+1 then T(X)=T(X)+1; 90 next X; 100 if B>10^2+1 then 140; 110 B=A; 120 N=N+1; 130 goto 30; 140 for x=2 to 34 step 2; 150 print T(X);, 160 next (This program simultaneously finds values from 2 to 34 -- if gap=2 add 1-- adjust lines 80 and 100 for desired 10^n)
    

Extensions

a(10)-a(13) from Washington Bomfim, Jun 22 2012
a(14)-a(18) from S. Herzog's website added by Giovanni Resta, Aug 14 2018

A093972 Number of prime pairs below 10^n having a difference of 36.

Original entry on oeis.org

0, 0, 0, 1, 54, 767, 10194, 114028, 1171524, 11593345, 112117864, 1069300358, 10109375268, 95086492066, 891766724342, 8351325770872, 78171510043913, 731828924318516
Offset: 1

Views

Author

Enoch Haga, Apr 24 2004

Keywords

Examples

			a(4) = 1 because there is 1 prime gap of 36 below 10^4.
		

Crossrefs

Extensions

a(10)-a(13) from Washington Bomfim, Jun 22 2012
a(14)-a(18) from S. Herzog's website added by Giovanni Resta, Aug 14 2018

A118552 Sum of the twin prime pairs less than 10^n.

Original entry on oeis.org

20, 488, 24236, 1726412, 109114568, 7424366648, 545678596592, 41205774636932, 3234489739234676, 260643410442091112, 21446976192435396140, 1795640886305783918948, 152542601906447626814216, 13119246582832293524505360
Offset: 1

Views

Author

Cino Hilliard, May 07 2006

Keywords

Comments

The PARI program can compute the first 9 terms in reasonable time. a(10) was computed by the program in the link. This took 145 sec on a p4 2.53 GHz processor while a(13) took 1.4 days and a(14) took 15 days with multitasking. The sum of twin primes < 10^n divided by 4 gives a very good approximation for the number of twin primes < 10^(2n). E.g., sum of twin primes <= 10^8 divided by 4 = 10301443659233. Pi_2(10^16) = 10304185697298. This is an error of 0.00002661. Pi_2(n): Number of twin prime pairs <= n.

Examples

			(3,5),(5,7) are the two twin prime pairs less than 10. These add up to 20, the first term in the sequence.
		

Crossrefs

Cf. A007508.

Programs

  • PARI
    sumtwins(n) = { local(x,j,s,sr,p10x); for(x=1,n, s=0; p10x=10^x; forstep(j=3,10^x,2, if(j+2 < p10x && ispseudoprime(j) && ispseudoprime(j+2),s+=j+j+2); ); print1(s","); ) }

Extensions

2 more terms from Giovanni Resta, May 08 2006
a(13) and a(14) added, comment expanded, program at link improved, and example edited by Cino Hilliard, Nov 18 2008

A181678 Number of twin Ramanujan prime pairs less than 10^n.

Original entry on oeis.org

0, 0, 10, 73, 508, 3468, 25629, 194614, 1537504, 12447679, 102834428
Offset: 1

Views

Author

T. D. Noe, Nov 18 2010

Keywords

Crossrefs

Cf. A178127 (lesser of twin Ramanujan primes), A007508 (number of twin primes pairs < 10^n), A190654 (twin Ramanujan primes).

Programs

  • Mathematica
    nn=50000; t=Table[0,{nn}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s
    				
  • Perl
    use ntheory ":all"; for my $n (0..9) { my $r = ramanujan_primes(10**$n); my $t=0; for (0..$#$r-1) { $t++ if $r->[$+1] - $r->[$] == 2; } say "$n $t"; } # Dana Jacobsen, Sep 06 2015

Extensions

a(10)-a(11) from Dana Jacobsen, Apr 29 2015

A093683 Number of pairs of twin primes <= 10^n-th prime.

Original entry on oeis.org

4, 25, 174, 1270, 10250, 86027, 738597, 6497407, 58047180, 524733511, 4789919653, 44073509102, 408231310520
Offset: 1

Views

Author

Enoch Haga, Apr 09 2004

Keywords

Comments

This sequence is >= the values of pi(10^n): 4, 25, 168, 1229, ... in A006880.
a(0) = 0. - Eduard Roure Perdices, Dec 23 2022

Examples

			a(1) = 4 because there are 4 twin primes <= 29, the 10th prime: (3,5), (5,7), (11,13), and (17,19). (29,31) is not counted because it is not entirely <= 29.
		

References

  • Enoch Haga, "Wandering through a prime number desert," Table 6, in Exploring prime numbers on your PC and the Internet, 2001 (ISBN 1-885794-17-7).

Crossrefs

See A049035 for another version. - R. J. Mathar, Sep 05 2008

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = q = 1; Do[l = Prime[10^n]; While[q <= l, If[p + 2 == q, c++ ]; p = q; q = NextPrim[p]]; Print[c], {n, 12}] (* Robert G. Wilson v, Apr 10 2004 *)
  • Python
    from sympy import prime, sieve # use primerange for larger terms
    def afind(terms):
      c, prevp = 0, 1
      for n in range(1, terms+1):
        for p in sieve.primerange(prevp+1, prime(10**n)+1):
          if prevp == p - 2: c += 1
          prevp = p
        print(c, end=", ")
    afind(6) # Michael S. Branicky, Apr 25 2021

Formula

Count twin primes <= p_{10^n}: 10th prime, 100th prime, etc.

Extensions

a(9) from Michael S. Branicky, Apr 25 2021
a(10) from Eduard Roure Perdices, May 08 2021
a(11) from Eduard Roure Perdices, Feb 03 2022
a(12) from Eduard Roure Perdices, Dec 23 2022
a(13) from Eduard Roure Perdices, Jan 24 2024

A093739 Number of prime pairs below 10^n having a difference of 8.

Original entry on oeis.org

0, 1, 15, 101, 773, 5569, 42352, 334180, 2695109, 22160841, 185402143, 1573331564, 13515180171, 117333792953, 1028087693781, 9081524454631, 80799078096971, 723494891844589
Offset: 1

Views

Author

Enoch Haga, Apr 15 2004

Keywords

Examples

			a(3) = 15 because there are 15 prime gaps of 8 below 10^3.
		

Crossrefs

Programs

  • UBASIC
    20 N=1:dim T(34);
    30 A=nxtprm(N);
    40 N=A;
    50 B=nxtprm(N);
    60 D=B-A;
    70 for x=2 to 34 step 2;
    80 if D=X and B<10^2+1 then T(X)=T(X)+1;
    90 next X;
    100 if B>10^2+1 then 140;
    110 B=A;
    120 N=N+1;
    130 goto 30;
    140 for x=2 to 34 step 2;
    150 print T(X);,
    160 next
    ## (This program simultaneously finds values from 2 to 34 - if gap=2 add 1- adjust lines 80 and 100 for desired 10^n)

Extensions

a(10)-a(13) from Washington Bomfim, Jun 20 2012
a(14)-a(18) from S. Herzog's website added by Giovanni Resta, Aug 14 2018

A093740 Number of prime pairs below 10^n having a difference of 10.

Original entry on oeis.org

0, 0, 16, 119, 916, 7079, 54431, 430016, 3484767, 28764495, 241298621, 2052293026, 17663498098, 153590992984, 1347587381486, 11917605558274, 106139298948562, 951243890034661
Offset: 1

Views

Author

Enoch Haga, Apr 15 2004

Keywords

Examples

			a(3) = 16 because there are 16 prime gaps of 10 below 10^3.
		

Crossrefs

Programs

  • UBASIC
    20 N=1:dim T(34);
    30 A=nxtprm(N);
    40 N=A;
    50 B=nxtprm(N);
    60 D=B-A;
    70 for x=2 to 34 step 2;
    80 if D=X and B<10^2+1 then T(X)=T(X)+1;
    90 next X;
    100 if B>10^2+1 then 140;
    110 B=A;
    120 N=N+1;
    130 goto 30;
    140 for x=2 to 34 step 2;
    150 print T(X);,
    160 next
    ## (This program simultaneously finds values from 2 to 34 - if gap=2 add 1- adjust lines 80 and 100 for desired 10^n)

Extensions

a(10)-a(13) from Washington Bomfim, Jun 20 2012
a(14)-a(18) from S. Herzog's website added by Giovanni Resta, Aug 14 2018

A093741 Number of prime pairs below 10^n having a difference of 12.

Original entry on oeis.org

0, 0, 7, 105, 964, 8005, 65513, 538382, 4468957, 37588207, 319972455, 2753597777, 23931289984, 209796541197, 1853552707266, 16490531511496, 147632682729513, 1329180643501191
Offset: 1

Views

Author

Enoch Haga, Apr 15 2004

Keywords

Examples

			a(3) = 7 because there are 7 prime gaps of 12 below 10^3.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Differences[Prime[Range[PrimePi[10^n]]]],12],{n,10}] (* The program generates the first 10 terms of the sequence. *) (* Harvey P. Dale, Jun 24 2025 *)
  • UBASIC
    20 N=1:dim T(34); 30 A=nxtprm(N); 40 N=A; 50 B=nxtprm(N); 60 D=B-A; 70 for x=2 to 34 step 2; 80 if D=X and B<10^2+1 then T(X)=T(X)+1; 90 next X; 100 if B>10^2+1 then 140; 110 B=A; 120 N=N+1; 130 goto 30; 140 for x=2 to 34 step 2; 150 print T(X);, 160 next (This program simultaneously finds values from 2 to 34 -- if gap=2 add 1-- adjust lines 80 and 100 for desired 10^n)

Extensions

a(10)-a(13) from Washington Bomfim, Jun 22 2012
a(14)-a(18) from S. Herzog's website added by Giovanni Resta, Aug 14 2018

A093742 Number of prime pairs below 10^n having a difference of 14.

Original entry on oeis.org

0, 0, 7, 54, 484, 4233, 35394, 293201, 2464565, 20943953, 179718000, 1556469349, 13597962107, 119731244640, 1061769557793, 9476573902533, 85076550195696, 767846949916102
Offset: 1

Views

Author

Enoch Haga, Apr 15 2004

Keywords

Examples

			a(3) = 7 because there are 7 prime gaps of 14 below 10^3.
		

Crossrefs

Programs

  • UBASIC
    20 N=1:dim T(34); 30 A=nxtprm(N); 40 N=A; 50 B=nxtprm(N); 60 D=B-A; 70 for x=2 to 34 step 2; 80 if D=X and B<10^2+1 then T(X)=T(X)+1; 90 next X; 100 if B>10^2+1 then 140; 110 B=A; 120 N=N+1; 130 goto 30; 140 for x=2 to 34 step 2; 150 print T(X);, 160 next (This program simultaneously finds values from 2 to 34 -- if gap=2 add 1-- adjust lines 80 and 100 for desired 10^n)

Extensions

a(10)-a(13) from Washington Bomfim, Jun 22 2012
a(14)-a(18) from S. Herzog's website added by Giovanni Resta, Aug 14 2018
Previous Showing 11-20 of 53 results. Next