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
- A. Granville, G. Martin, Prime number races, Amer. Math. Monthly vol 113, no 1 (2006) p 1.
- Eric Weisstein's World of Mathematics, Sexy Primes. [The definition in this webpage is unsatisfactory, because it defines a "sexy prime" as a pair of primes.- _N. J. A. Sloane_, Mar 07 2021].
-
{c=0; p=7; for(n=1,9, while(p<10^n,if(isprime(p-6),c++); p=nextprime(p+1)); print1(c,","))}
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
a(2) = 7 because there are 7 prime gaps of 4 below 10^2.
-
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
-
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)
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
a(4) = 1 because there is 1 prime gap of 36 below 10^4.
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
(3,5),(5,7) are the two twin prime pairs less than 10. These add up to 20, the first term in the sequence.
-
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","); ) }
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
Cf.
A178127 (lesser of twin Ramanujan primes),
A007508 (number of twin primes pairs < 10^n),
A190654 (twin Ramanujan primes).
-
nn=50000; t=Table[0,{nn}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s
-
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
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
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.
- 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).
-
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 *)
-
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
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
a(3) = 15 because there are 15 prime gaps of 8 below 10^3.
-
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)
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
a(3) = 16 because there are 16 prime gaps of 10 below 10^3.
-
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)
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
a(3) = 7 because there are 7 prime gaps of 12 below 10^3.
-
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 *)
-
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)
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
a(3) = 7 because there are 7 prime gaps of 14 below 10^3.
-
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)
a(14)-a(18) from S. Herzog's website added by
Giovanni Resta, Aug 14 2018
Comments