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.

A143738 Number of twin primes between n and n^2. Only smaller of twins (terms of A001359) are counted.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 5, 6, 6, 8, 8, 9, 11, 12, 14, 16, 16, 17, 17, 19, 20, 21, 22, 24, 26, 26, 26, 29, 30, 30, 31, 34, 36, 36, 39, 41, 42, 45, 45, 48, 49, 50, 53, 55, 59, 61, 63, 66, 66, 68, 70, 74, 74, 76, 77, 78, 83, 87, 90, 91, 93, 96, 100
Offset: 1

Views

Author

Alen Skugor (askugor(AT)gmail.com), Aug 30 2008

Keywords

Examples

			For n = 6, between 6 and 36 the smaller of twin pairs are {11, 17, 29}, so a(6) = 3.
		

Crossrefs

Programs

  • Magma
    [#[p:p in PrimesInInterval(n,n^2)|IsPrime(p+2)]:n in [1..80]]; // Marius A. Burtea, Dec 20 2019
  • Mathematica
    Table[Count[Table[PrimeQ[j] && PrimeQ[j + 2], {j, n, n*n}], True], {n, 1, 100}]

A080357 Smallest x such that between x and 2x exactly n twin prime numbers can be found.

Original entry on oeis.org

2, 3, 36, 54, 90, 96, 99, 135, 174, 330, 411, 414, 516, 531, 546, 651, 714, 726, 741, 744, 804, 936, 939, 966, 975, 999, 1014, 1071, 1134, 1170, 1191, 1365, 1395, 1401, 1650, 1665, 1686, 1695, 1764, 1770, 1779, 1836, 1926, 2010, 2025, 2064, 2079, 2136, 2211
Offset: 1

Views

Author

Labos Elemer, Feb 19 2003

Keywords

Examples

			n=7: first seven twin primes counted between 99 and 198: {101,107,137,149,179,191,197}.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := Count[Table[PrimeQ[j]&&PrimeQ[j+2], {j, x, 2*x}], True] t=Table[0, {100}]; Do[s=f[n]; If[s<101&&t[[s]]==0, t[[s]]=n], {n, 1, 10000}]; t

Formula

a(n)=Min[x; A080356(x)=n]

A344117 Number of twin prime pairs in the range (6*n + 1, 6*(n + m) + 1], where m is the number of twin prime pairs, 6*k +- 1 for k = 1, 2, ..., n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 3, 3, 4, 4, 3, 3, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
Offset: 1

Views

Author

Ya-Ping Lu, Jun 24 2021

Keywords

Comments

Conjecture: a(n) >= 1.

Crossrefs

Programs

  • Python
    from sympy import isprime
    def istwin(m): return 1 if isprime(6*m-1)*isprime(6*m+1) == 1 else 0
    ct1 = 0
    for n in range(1, 100):
        ct1 += istwin(n); ct = 0
        for m in range (n + 1, n + ct1 + 1): ct += istwin(m)
        print(ct)
Showing 1-3 of 3 results.