A086139 Let p = A046133(n), that is, let p run through the list of primes such that p+12 is also prime (A046133); a(n) = number of primes in the interval p + 1 through p + 11 inclusive.
3, 3, 3, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 3, 3, 2, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 0, 1, 1, 1, 2, 0, 1, 2, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 0, 2, 2, 2, 2, 0, 1, 2, 1, 2, 0, 1, 3, 2, 0, 0, 0, 1, 1, 1, 2, 2
Offset: 1
Keywords
Examples
For n=1, we have p=5, the primes between 5 and 5+12=17 are 7,11,13, so a(1)=3.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Maple
a:=[]; b:=[]; for n from 1 to 200 do if isprime(ithprime(n)+12) then a:=[op(a),ithprime(n)]; c:=0; for i from 1 to 11 do if isprime(ithprime(n)+i) then c:=c+1; fi; od; b:=[op(b),c]; fi; od: a; # A046133b; # this sequence
-
Mathematica
cp[x_,y_] := Count[Table[PrimeQ[i],{i,x,y}],True]; d = 12; Do[s = Prime[n]; If[PrimeQ[s+d], Print[cp[s+1,s+d-1]]], {n, 1, 1000}] (* Second program: *) With[{d = 12}, DeleteCases[#, -1] &@ Table[Function[p, If[PrimeQ[p + d], Count[Range[p + 1, p + d - 1], _?PrimeQ], -1] ]@ Prime@ n, {n, 252}]] PrimePi[#+11]-PrimePi[#+1]&/@Select[Prime[Range[400]],PrimeQ[#+12]&] (* Harvey P. Dale, Jul 30 2022 *)
Extensions
Definition edited by N. J. A. Sloane, Aug 05 2017 following analysis by Michael De Vlieger, Jul 30 2017
Comments