A086137 Number of primes between p and p+8 if p is prime, i.e., number of primes between 8+A023202(n) and A023202(n).
2, 2, 2, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 2, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 2, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 1, 0, 2, 0, 1, 1, 0, 0, 0, 1, 0, 1
Offset: 1
Keywords
Examples
a(n)=0,1,2 correspond to {p,p+8} prime-pairs either consecutive or pairs with various d-patterns as follows: a(n)=0 to 89[8]97; a(n)=1 for 29[2,6]37, 53[6,2]; a(n)=2 for 101[2,4,2]109 and once to 3[2,2,4]11.
Programs
-
Mathematica
cp[x_,y_] := Count[Table[PrimeQ[i],{i,x,y}],True] Do[s=Prime[n]; s1=Prime[n+1]; If[PrimeQ[s+d],k=k+1; Print[cp[s+1,s+d-1]]],{n,1,1000}]; k
Comments