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
T. D. Noe, Table of n, a(n) for n=3..10000
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
KEYWORD
easy,nonn,nice
AUTHOR
Hugo Pfoertner, Jan 22 2004
STATUS
approved