OFFSET
1,3
COMMENTS
Here a twin prime is counted even if only one member of the twin-prime pair is between n and 2n, inclusive. Note that this sequence is very close to 2*A088018. It appears that a(n) > 0 for all n > 1. However, it has not been proved that there are an infinite number of twin primes.
LINKS
T. D. Noe, Table of n, a(n) for n=1..10000
Eric Weisstein's World of Mathematics, Twin Primes
MATHEMATICA
pl=Prime[Range[PrimePi[20000]]]; twl={}; Do[If[pl[[i-1]]+2==pl[[i]], twl=Join[twl, {pl[[i-1]], pl[[i]]}]], {i, 2, Length[pl]}]; twl=Union[twl]; i1=1; i2=1; nMin=(twl[[1]]-1)/2; nMax=(twl[[ -1]]+1)/2; Join[Table[0, {nMin-1}], Table[While[twl[[i1]]<n, i1++ ]; While[i2<=Length[twl]&&twl[[i2]]<2n, i2++ ]; i2-i1, {n, nMin, nMax}]]
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
T. D. Noe, Sep 18 2003
STATUS
approved