

A071538


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


17



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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,5


COMMENTS

The convention is followed that a twin prime is <= n if its smaller member is <= n.
Except for (3, 5), every pair of twin primes is congruent (1, +1) (mod 6).  Daniel Forgues, Aug 05 2009
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. AdamsWatters, Jun 01 2014


REFERENCES

S. Lang, The Beauty of Doing Mathematics, pp. 1215; 2122, SpringerVerlag NY 1985.


LINKS

Daniel Forgues, Table of n, a(n) for n = 1..99998
Thomas R. Nicely, Some Results of Computational Research in Prime Numbers.
Eric Weisstein's World of Mathematics, Twin Primes.


EXAMPLE

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


MATHEMATICA

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 *)


PROG

(PARI) A071538(n) = local(s=0, L=0); forprime(p=3, n+2, L==p2 & s++; L=p); s
/* For n > primelimit, one may use: */ A071538(n) = { local(s=isprime(2+n=precprime(n))&n, L); while( n=precprime(L=n2), L==n & s++); s }
/* The following gives a reasonably good estimate for small and for large values of n (cf. A007508): */
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


CROSSREFS

Cf. A007508, A033843, A001359, A006512.
Sequence in context: A098429 A132090 A235043 * A321017 A138194 A133876
Adjacent sequences: A071535 A071536 A071537 * A071539 A071540 A071541


KEYWORD

nonn


AUTHOR

Reinhard Zumkeller, May 30 2002


EXTENSIONS

Definition edited by Daniel Forgues, Jul 29 2009


STATUS

approved



