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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

Reinhard Zumkeller, May 30 2002

Keywords

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. Adams-Watters, Jun 01 2014

Examples

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

References

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

Crossrefs

Programs

  • 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 *)
  • PARI
    A071538(n) = local(s=0,L=0); forprime(p=3,n+2,L==p-2 & 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=n-2),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

Extensions

Definition edited by Daniel Forgues, Jul 29 2009

A095017 Number of lesser twin primes (A001359) in range ]2^n, 2^(n+1)].

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 7, 7, 12, 26, 45, 70, 113, 215, 355, 666, 1153, 2071, 3785, 6965, 12495, 22643, 41608, 76371, 140944, 261752, 484968, 904799, 1689477, 3160113, 5928904, 11139071, 20970782, 39535081, 74697745, 141342490, 267812262, 508194094, 965623233, 1837147717
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Comments

Conjecture: a(n) > 0 for all n. This holds for all n <= 100. - Charles R Greathouse IV, May 14 2012
It appears that a(n+1) is approximately 2 * a(n) * (n/(n+1))^2. The 2 accounts for each segment of numbers being twice as large as the previous segment. The first n/(n+1) accounts for primes being less common as numbers increase in size. The second n/(n+1) accounts for twin primes being a less common gap size as numbers increase in size. This formula has increasing accuracy as the numbers increase and is better than 0.1% by the end of the known sequence. - Jerry M Lagrou, Jan 05 2025

Crossrefs

Programs

  • Mathematica
    Table[ps = Prime[Range[PrimePi[2^n] + 1, PrimePi[2^(n+1) + 1]]]; Count[Differences[ps], 2], {n, 25}] (* T. D. Noe, May 08 2012 *)
  • PARI
    a095017(maxex2)={my (L=List([1]), p2=8, n2=0, pp=5); forprime (p=7, 2^maxex2, if (p>p2, p2*=2; listput(L,n2); n2=0); if (p-pp==2, n2++); pp=p); Vec(L)};
    a095017(30) \\ Hugo Pfoertner, Feb 05 2024

Extensions

a(34) and beyond from Jerry M Lagrou, Dec 02 2023

A215473 Number of prime quadruples with smallest member < 2^n.

Original entry on oeis.org

0, 0, 1, 2, 2, 2, 3, 4, 4, 5, 7, 10, 11, 16, 23, 28, 43, 62, 106, 177, 309, 483, 795, 1305, 2105, 3525, 5923, 10096, 17259, 30004
Offset: 1

Views

Author

Alex Ratushnyak, Aug 12 2012

Keywords

Comments

Prime quadruples (A007530) are numbers n such that n, n+2, n+6, n+8 are all prime.

Examples

			a(3) = 1 because there is only one prime quadruple below 2^3, namely {5, 7, 11, 13}.
a(4) = 2 because there are two prime quadruples below 2^4: the aforementioned and {11, 13, 17, 19}.
		

Crossrefs

Cf. A050258, similar definition but with powers of 10 instead of 2.

Programs

Showing 1-3 of 3 results.