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.

A093683 Number of pairs of twin primes <= 10^n-th prime.

Original entry on oeis.org

4, 25, 174, 1270, 10250, 86027, 738597, 6497407, 58047180, 524733511, 4789919653, 44073509102, 408231310520
Offset: 1

Views

Author

Enoch Haga, Apr 09 2004

Keywords

Comments

This sequence is >= the values of pi(10^n): 4, 25, 168, 1229, ... in A006880.
a(0) = 0. - Eduard Roure Perdices, Dec 23 2022

Examples

			a(1) = 4 because there are 4 twin primes <= 29, the 10th prime: (3,5), (5,7), (11,13), and (17,19). (29,31) is not counted because it is not entirely <= 29.
		

References

  • Enoch Haga, "Wandering through a prime number desert," Table 6, in Exploring prime numbers on your PC and the Internet, 2001 (ISBN 1-885794-17-7).

Crossrefs

See A049035 for another version. - R. J. Mathar, Sep 05 2008

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; c = 0; p = q = 1; Do[l = Prime[10^n]; While[q <= l, If[p + 2 == q, c++ ]; p = q; q = NextPrim[p]]; Print[c], {n, 12}] (* Robert G. Wilson v, Apr 10 2004 *)
  • Python
    from sympy import prime, sieve # use primerange for larger terms
    def afind(terms):
      c, prevp = 0, 1
      for n in range(1, terms+1):
        for p in sieve.primerange(prevp+1, prime(10**n)+1):
          if prevp == p - 2: c += 1
          prevp = p
        print(c, end=", ")
    afind(6) # Michael S. Branicky, Apr 25 2021

Formula

Count twin primes <= p_{10^n}: 10th prime, 100th prime, etc.

Extensions

a(9) from Michael S. Branicky, Apr 25 2021
a(10) from Eduard Roure Perdices, May 08 2021
a(11) from Eduard Roure Perdices, Feb 03 2022
a(12) from Eduard Roure Perdices, Dec 23 2022
a(13) from Eduard Roure Perdices, Jan 24 2024