A204136 Number of composites between successive twin prime pairs.
0, 3, 3, 8, 8, 13, 8, 23, 3, 24, 9, 23, 9, 3, 25, 8, 24, 8, 25, 30, 59, 9, 23, 50, 41, 24, 13, 20, 13, 129, 9, 3, 25, 19, 118, 9, 14, 9, 25, 51, 66, 42, 8, 8, 14, 97, 18, 25, 3, 102, 8, 41, 26, 20, 56, 74, 3, 47, 15, 41, 24, 47, 3, 20, 15, 8, 86, 25, 34, 26
Offset: 1
Keywords
Examples
a(4)= 8 because between the 4th and 5th pairs of twins (17,19) and (29,31), there are 8 composites: 20, 21, 22, 24, 25, 26, 27, 28.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
T:=array(1..200,1..2):k:=0:for n from 1 to 1000 do:p1:=ithprime(n):p2:=ithprime(n+1):if p2-p1 = 2 then k:=k+1:T[k,1]:=p1:T[k,2]:=p2:else fi:od: for p from 1 to k do:i:= T[p,2]+1: j:= T[p+1,1]-1 :ii:=0:for q from i to j do:if type(q,prime)=false then ii:=ii+1:else fi:od: printf(`%d, `,ii):od:
-
Mathematica
nc[{a_,b_}]:=Count[Range[a+3,b-1],?(!PrimeQ[#]&)]; With[{tp=Partition[ Transpose[ Select[Partition[Prime[Range[ 500]],2,1],Last[#]-First[#] == 2&]][[1]],2,1]},nc/@tp] (* _Harvey P. Dale, Jun 25 2013 *)