A091591 Number of pairs of twin primes between n^2 and (n+1)^2.
1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 2, 1, 2, 2, 1, 1, 0, 2, 1, 1, 1, 2, 2, 0, 0, 3, 2, 0, 1, 3, 2, 0, 3, 2, 1, 3, 0, 3, 2, 1, 3, 2, 4, 2, 2, 3, 0, 2, 2, 4, 0, 2, 1, 1, 5, 4, 4, 1, 2, 3, 4, 3, 5, 2, 2, 3, 2, 4, 1, 2, 2, 3, 4, 3, 0, 3, 3, 2, 4, 5, 2, 2, 3, 4, 1, 2, 3, 2, 3, 3, 1, 5, 1, 3, 4, 4, 2, 5, 3, 4, 1, 3, 5, 1, 2
Offset: 3
Examples
a(3)=1 because the interval [3^2,4^2] contains one pair of twins (11,13). a(9)=0 because the interval [9^2,10^2] is one of the few known intervals (given in A091592) not containing twin primes.
Links
- T. D. Noe, Table of n, a(n) for n=3..10000
- Eric Weisstein's World of Mathematics, Twin Prime Conjecture.
Crossrefs
Programs
-
Mathematica
a[n_] := (k = 0; For[p = NextPrime[n^2], p <= NextPrime[(n + 1)^2, -2], q = NextPrime[p]; If[q - p == 2, k++; p = NextPrime[q], p = q]]; k); Table[a[n], {n, 3, 107}] (* Jean-François Alcover, Jun 13 2012 *) With[{tps=Select[Partition[Prime[Range[2000]],2,1],Last[#]-First[#] == 2&]},Table[ Count[tps,?(#[[1]]>n^2&&#[[2]]<(n+1)^2&)],{n,3,110}]] (* _Harvey P. Dale, Feb 19 2013 *)
Comments