cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A091591 Number of pairs of twin primes between n^2 and (n+1)^2.

This page as a plain text file.
%I A091591 #22 Feb 16 2025 08:32:52
%S A091591 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,
%T A091591 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,
%U A091591 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
%N A091591 Number of pairs of twin primes between n^2 and (n+1)^2.
%C A091591 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.
%C A091591 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
%H A091591 T. D. Noe, <a href="/A091591/b091591.txt">Table of n, a(n) for n=3..10000</a>
%H A091591 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TwinPrimeConjecture.html">Twin Prime Conjecture.</a>
%e A091591 a(3)=1 because the interval [3^2,4^2] contains one pair of twins (11,13).
%e A091591 a(9)=0 because the interval [9^2,10^2] is one of the few known intervals (given in A091592) not containing twin primes.
%t A091591 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 *)
%t A091591 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 *)
%Y A091591 Cf. A000290, A001359, A006512, A091592.
%Y A091591 Cf. A014085 (number of primes between n^2 and (n+1)^2)
%K A091591 easy,nonn,nice
%O A091591 3,8
%A A091591 _Hugo Pfoertner_, Jan 22 2004