%I M1855 #109 Apr 03 2023 10:36:09
%S 2,8,35,205,1224,8169,58980,440312,3424506,27412679,224376048,
%T 1870585220,15834664872,135780321665,1177209242304,10304195697298,
%U 90948839353159,808675888577436
%N Number of twin prime pairs below 10^n.
%C "At the present time (2001), Thomas Nicely has reached pi_2(3*10^15) and his value is confirmed by Pascal Sebah who made a new computation from scratch and up to pi_2(5*10^15) [ = 5357875276068] with an independent implementation."
%C Though the first paper contributed by D. A. Goldston was reported to be flawed, the more recent one (with other coauthors) maintains and substantiates the result. - _Lekraj Beedassy_, Aug 19 2005
%C Theorem. While g is even, g > 0, number of primes p < x (x is integer) such that p' = p + g is also prime, could be written as qpg(x) = qcc(x) - (x - pi(x) - pi(x + g) + 1) where qcc(x) is the number of "common composite numbers" c <= x such that c and c' = c + g both are composite (see Example below; I propose it here as a theorem only not to repeat for so-called "cousin"-primes (p; p+4), "sexy"-primes (p; p+6), etc.). - _Sergey Pavlov_, Apr 08 2021
%D P. Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 202.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Richard P. Brent, <a href="https://doi.org/10.1090/S0025-5718-1975-0369287-1">Irregularities in the distribution of primes and twin primes</a>, Math. Comp. 29 (1975), 43-56.
%H C. K. Caldwell, <a href="http://www.utm.edu/~caldwell/preprints/Heuristics.pdf">An amazing prime heuristic</a>, Table 1.
%H C. K. Caldwell, The Prime Glossary, <a href="https://t5k.org/glossary/page.php/TwinPrimeConjecture.html">Twin prime conjecture</a>
%H T. H. Chan, <a href="https://arxiv.org/abs/math/0503441">A note on Primes in Short Intervals</a>, arXiv:math/0503441 [math.NT], 2005.
%H P. Erdős, <a href="http://dx.doi.org/10.1307/mmj/1028997963">Some Unsolved Problems</a>, Michigan Math. J., Volume 4, Issue 3 (1957), 291-300.
%H G. H. Gadiyar & R. Padma, <a href="http://arXiv.org/abs/hep-th/9806061">Renormalisation and the density of prime pairs</a>, arXiv:hep-th/9806061, 1998.
%H G. H. Gadiyar & R. Padma, <a href="http://empslocal.ex.ac.uk/people/staff/mrwatkin/zeta/padma.pdf">Ramanujan-Fourier series, the Wiener-Khintchine formula and the distribution of prime pairs</a>, Physica A 269 (1999) 503-510.
%H D. A. Goldston, J. Pintz & C. Y. Yildirim, <a href="https://arxiv.org/abs/math/0508185">Primes in Tuples, I</a>, arXiv:math/0508185 [math.NT], 2005.
%H D. A. Goldston, J. Pintz & C. Y. Yildirim, <a href="http://www.math.sjsu.edu/~goldston/gpy02-08-05.pdf">Small Gaps Between Primes, II</a>
%H D. A. Goldston, J. Pintz & C. Y. Yildirim, <a href="http://arXiv.org/abs/math/0512436">The Path to Recent Progress on Small Gaps Between Primes</a>, arXiv:math/0512436 [math.NT], 2005-2006.
%H D. A. Goldston & C. Y. Yildirim, <a href="https://arxiv.org/abs/math/0504336">Small Gaps Between Primes, I</a>, arXiv:math/0504336 [math.NT], 2005.
%H D. A. Goldston & C. Yildirim, <a href="https://web.archive.org/web/20080309063536/http://aimath.org/primegaps/goldston_tech/">Small gaps between consecutive primes</a>
%H D. A. Goldston et al., <a href="https://arxiv.org/abs/math/0506067">Small gaps between primes or almost primes</a>, arXiv:math/0506067 [math.NT], 2005.
%H D. A. Goldston et al., <a href="https://arxiv.org/abs/math/0505300">Small Gaps between Primes Exist</a>, arXiv:math/0505300 [math.NT], 2005.
%H Xavier Gourdon and Pascal Sebah, <a href="http://numbers.computation.free.fr/Constants/Primes/twin.html">Introduction to Twin Primes and Brun's Constant</a>
%H A. Granville & K. Soundararajan, <a href="https://web.archive.org/web/20110724230750/http://aimath.org/primegaps/residueerror/">On the error in Goldston and Yildirim's "Small gaps between consecutive primes"</a>
%H Gareth A. Jones and Alexander K. Zvonkin, <a href="https://arxiv.org/abs/2104.12015">Klein's ten planar dessins of degree 11, and beyond</a>, arXiv:2104.12015 [math.GR], 2021. See p. 24.
%H P. F. Kelly & F. Pilling, <a href="https://arxiv.org/abs/math/0103191">Characterization of the Distribution of Twin Primes</a>, arXiv:math/0103191 [math.NT], 2001.
%H P. F. Kelly & T. Pilling, <a href="https://arxiv.org/abs/math/0104205">Implications of a New Characterization of the Distribution of Twin Primes</a>, arXiv:math/0104205 [math.NT], 2001.
%H P. F. Kelly & T. Pilling, <a href="https://arxiv.org/abs/math/0106223">Discrete Reanalysis of a New Model of the Distribution of Twin Primes</a>, arXiv:math/0106223 [math.NT], 2001.
%H James Maynard, <a href="https://arxiv.org/abs/1910.14674">On the Twin Prime Conjecture</a>, arXiv:1910.14674 [math.NT], 2019, p. 2.
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> [For local copy see A000101]
%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/twins/twins.html">Enumeration to 10^14 of the twin primes and Brun's constant</a>, Virginia Journal of Science, 46:3 (Fall, 1995), 195-204.
%H Thomas R. Nicely, <a href="/A001359/a001359.pdf">Enumeration to 10^14 of the twin primes and Brun's constant</a> [Local copy, pdf only]
%H Nova Science, <a href="http://www.pbs.org/wgbh/nova/sciencenow/3302/02.html">Twin Prime Conjecture</a>
%H Tomás Oliveira e Silva, <a href="http://sweet.ua.pt/tos/primes.html">Tables of values of pi(x) and of pi2(x)</a> [From _M. F. Hasler_, Dec 18 2008]
%H J. Richstein, <a href="https://web.archive.org/web/20040911002922/http://www.informatik.uni-giessen.de/staff/richstein/res/tp-en.html">Computing the number of twin primes up to 10^14</a>
%H J. Richstein, <a href="https://web.archive.org/web/20070711220924/http://www.mscs.dal.ca/~joerg/res/tp-en.html">Computing the number of twin primes up to 10^14</a>
%H J. Sondow, J. W. Nicholson, and T. D. Noe, <a href="http://arxiv.org/abs/1105.2249"> Ramanujan Primes: Bounds, Runs, Twins, and Gaps</a>, arXiv:1105.2249 [math.NT], 2011; J. Integer Seq. 14 (2011) Article 11.6.2.
%H Jonathan P. Sorenson, Jonathan Webster, <a href="https://arxiv.org/abs/1807.08777">Two Algorithms to Find Primes in Patterns</a>, arXiv:1807.08777 [math.NT], 2018.
%H K. Soundararajan, <a href="https://arxiv.org/abs/math/0606408">The distribution of prime numbers</a>, arXiv:math/0606408 [math.NT], 2006.
%H K. Soundararajan, <a href="https://arxiv.org/abs/math/0605696">Small gaps between prime numbers:The work of Goldston-Pintz-Yildirim</a>, arXiv:math/0605696 [math.NT], 2006.
%H K. Soundararajan, <a href="http://dx.doi.org/10.1090/S0273-0979-06-01142-6">Small gaps between prime numbers:The work of Goldston-Pintz-Yildirim</a>, Bull. Amer. Math. Soc. 44 (2007), 1-18.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TwinPrimes.html">Twin Primes</a>
%H Eric Weisstein, Mathworld Headline News, <a href="http://mathworld.wolfram.com/news/2004-06-09/twinprimes">Twin Primes Proof Proffered</a>
%H M. Wolf, <a href="http://arXiv.org/abs/math/0105211">Some Remarks on the Distribution of twin Primes</a>, arXiv:math/0105211 [math.NT], 2001.
%H C. Yildirim & D. Goldston, <a href="http://www.math.boun.edu.tr/instructors/yildirim/yildirimtech.htm">Small gaps between consecutive primes</a>
%H <a href="/index/Pri#primepop">Index entries for sequences related to numbers of primes in various ranges</a>
%F Partial sums of A070076(n). - _Lekraj Beedassy_, Jun 11 2004
%F For 1 < n < 19, a(n) ~ e * pi(10^n) / (5*n - 5) = e * A006880(n) / (5*n - 5) where e is Napier's constant, see A001113 (probably, so is for any n > 18; we use n > 1 to avoid division by zero). - _Sergey Pavlov_, Apr 07 2021
%F For any n, a(n) = qcc(x) - (10^n - pi(10^n) - pi(10^n + 2) + 1) where qcc(x) is the number of "common composite numbers" c <= 10^n such that c and c' = c + 2 both are composite (trivial). - _Sergey Pavlov_, Apr 08 2021
%e For x = 10, qcc(x) = 4 (since 2 is prime; 4, 6, 8, 10 are even, and no odd 0 < d < 25 such that both d and d' = d + 2 are composite), pi(10) = 4, pi(10 + 2) = 5, but, while v = 2+2 or v = 2-2 would be even, we must add 1; hence, a(1) = qcc(10^1) - (10^1 - pi(10^1) - pi(10^1 + 2) + 1) = 4 - (10 - 4 - 5 + 1) = 2 (trivial). - _Sergey Pavlov_, Apr 08 2021
%t ile = 2; Do[Do[If[(PrimeQ[2 n - 1]) && (PrimeQ[2 n + 1]), ile = ile + 1], {n, 5*10^m, 5*10^(m + 1)}]; Print[{m, ile}], {m, 0, 7}] (* _Artur Jasinski_, Oct 24 2011 *)
%o (PARI) a(n)=my(s,p=2);forprime(q=3,10^n,if(q-p==2,s++);p=q);s \\ _Charles R Greathouse IV_, Mar 21 2013
%Y Cf. A001097.
%Y Cf. A173081 and A181678 (number of twin Ramanujan prime pairs below 10^n).
%Y Cf. A152051, A347278, A347279.
%K nonn,nice,hard,more
%O 1,1
%A _N. J. A. Sloane_, _Robert G. Wilson v_
%E pi2(10^15) due to Nicely and Szymanski, contributed by _Eric W. Weisstein_
%E pi2(10^16) due to Pascal Sebah, contributed by _Robert G. Wilson v_, Aug 22 2002
%E Added a(17)-a(18) computed by Tomás Oliveira e Silva and link to his web site. - _M. F. Hasler_, Dec 18 2008
%E Definition corrected by _Max Alekseyev_, Oct 25 2010
%E a(16) corrected by _Dana Jacobsen_, Mar 28 2014