%I #19 Oct 13 2015 18:24:50
%S 2,2,2,2,2,2,2,1,2,3,2,3,3,3,4,3,2,1,2,3,2,2,3,4,2,0,3,5,2,1,4,5,2,3,
%T 5,3,4,3,3,5,3,4,5,6,6,4,5,3,2,4,6,4,2,3,2,6,9,8,5,3,5,7,7,8,7,4,5,5,
%U 6,5,3,4,5,7,7,3,3,6,5,6,9,7,4,5,7,5,3,5,5,5,6
%N Number of twin prime pairs between n^2 and (n+2)^2.
%C Conjecture: (i) a(n) > 0 except for n = 26.
%C (ii) For any integer n > 0, there is a cousin prime pair {p, p+4} between n^2 and (n+2)^2.
%C (iii) For each n = 1,2,3,... there is a prime p between n^2 and (n+2)^2 such that 2*p-1 is also prime. Also, for any integer n > 0 not equal to 55, there is a Sophie Germain prime between n^2 and (n+2)^2.
%C Compare this with Legendre's conjecture which states that for any integer n > 0 there is a prime between n^2 and (n+1)^2.
%H Zhi-Wei Sun, <a href="/A263204/b263204.txt">Table of n, a(n) for n = 1..10000</a>
%e a(1) = 2 since there are exactly two twin prime pairs (namely, {3, 5} and {5, 7}) between 1^2 = 1 and (1+2)^2 = 9.
%e a(8) = 1 since there is a unique twin prime pair {71, 73} between 8^2 = 64 and (8+2)^2 = 100.
%e a(18) = 1 since there is a unique twin prime pair {347, 349} between 18^2 = 324 and (18+2)^2 = 400.
%e a(30) = 1 since there is a unique twin prime pair {1019, 1021} between 30^2 = 900 and (30+2)^2 = 1024.
%t TW[n_]:=TW[n]=PrimeQ[Prime[n]+2]
%t Do[r=0;Do[If[TW[k],r=r+1],{k,PrimePi[n^2]+1,PrimePi[(n+2)^2-2]}];Print[n," ",r];Continue,{n,1,100}]
%o (Perl) use ntheory ":all"; say twin_prime_count($_**2,($_+2)**2) for 1..100; # _Dana Jacobsen_, Oct 13 2015
%o (PARI) vector(100, n, my(t, p=2); forprime(q=n^2, (n+2)^2, if(q-p==2, t++); p=q); t) \\ _Altug Alkan_, Oct 13 2015
%Y Cf. A000290, A001097, A001359, A005382, A005384, A006512, A023200, A046132.
%K nonn
%O 1,1
%A _Zhi-Wei Sun_, Oct 10 2015