login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071538 Number of twin prime pairs (p, p+2) with p <= n. 19

%I #31 Oct 28 2021 13:09:16

%S 0,0,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,

%T 5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,

%U 7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8

%N Number of twin prime pairs (p, p+2) with p <= n.

%C The convention is followed that a twin prime is <= n if its smaller member is <= n.

%C Except for (3, 5), every pair of twin primes is congruent (-1, +1) (mod 6). - _Daniel Forgues_, Aug 05 2009

%C This function is sometimes known as pi_2(n). If this name is used, there is no obvious generalization for pi_k(n) for k > 2. - _Franklin T. Adams-Watters_, Jun 01 2014

%D S. Lang, The Beauty of Doing Mathematics, pp. 12-15; 21-22, Springer-Verlag NY 1985.

%H Daniel Forgues, <a href="/A071538/b071538.txt">Table of n, a(n) for n = 1..99998</a>

%H Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/">Some Results of Computational Research in Prime Numbers</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TwinPrimes.html">Twin Primes</a>.

%e a(30) = 5, since (29,31) is included along with (3,5), (5,7), (11,13) and (17,19).

%t primePi2[1] = 0; primePi2[n_] := primePi2[n] = primePi2[n - 1] + Boole[PrimeQ[n] && PrimeQ[n + 2]]; Table[primePi2[n], {n, 100}] (* _T. D. Noe_, May 23 2013 *)

%o (PARI) A071538(n) = local(s=0,L=0); forprime(p=3,n+2,L==p-2 & s++; L=p); s

%o /* For n > primelimit, one may use: */ A071538(n) = { local(s=isprime(2+n=precprime(n))&n,L); while( n=precprime(L=n-2),L==n & s++); s }

%o /* The following gives a reasonably good estimate for small and for large values of n (cf. A007508): */

%o A071538est(n) = 1.320323631693739*intnum(t=2,n+1/n,1/log(t)^2)-log(n) /* (The constant 1.320... is A114907.) */ \\ _M. F. Hasler_, Dec 10 2008

%Y Cf. A007508, A033843, A001359, A006512.

%K nonn

%O 1,5

%A _Reinhard Zumkeller_, May 30 2002

%E Definition edited by _Daniel Forgues_, Jul 29 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 13 20:16 EDT 2024. Contains 375910 sequences. (Running on oeis4.)