login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A091591
Number of pairs of twin primes between n^2 and (n+1)^2.
4
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,8
COMMENTS
a(1) and a(2) are omitted because they are dependent on the treatment of the twin pair (3,5). It is conjectured that a(n)>0 for all n>122. Proving this would also prove the twin prime conjecture.
Proving a(n)>0 for n>122 would also prove Legendre's conjecture that there is a prime between n^2 and (n+1)^2. - T. D. Noe, Feb 28 2007
LINKS
Eric Weisstein's World of Mathematics, Twin Prime Conjecture.
EXAMPLE
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.
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 *)
CROSSREFS
Cf. A014085 (number of primes between n^2 and (n+1)^2)
Sequence in context: A122901 A001917 A240545 * A376361 A337633 A358492
KEYWORD
easy,nonn,nice
AUTHOR
Hugo Pfoertner, Jan 22 2004
STATUS
approved