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.

A099980 Bisection of A001358.

Original entry on oeis.org

4, 9, 14, 21, 25, 33, 35, 39, 49, 55, 58, 65, 74, 82, 86, 91, 94, 106, 115, 119, 122, 129, 134, 142, 145, 155, 159, 166, 177, 183, 187, 201, 203, 206, 213, 215, 218, 221, 235, 247, 253, 259, 265, 274, 287, 291, 298, 301, 303, 309, 319, 323, 327, 334, 339, 346
Offset: 0

Views

Author

N. J. A. Sloane, Nov 19 2004

Keywords

Crossrefs

Cf. A001358.

Programs

  • Maple
    P:=[seq(ithprime(n),n=1..100)]: B:={seq(seq(P[i]*P[j],j=1..100),i=1..100)}:C:={seq(B[k],k=1..140)}: seq(C[2*j-1],j=1..70); # Emeric Deutsch, Dec 14 2004
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A099980(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int((n<<1)+1+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//p) for p in primerange(s+1)))
        return bisection(f,(n<<1)+1,(n<<1)+1) # Chai Wah Wu, Oct 23 2024

Extensions

More terms from Emeric Deutsch, Dec 14 2004