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.

A278568 Twice odd prime powers.

Original entry on oeis.org

2, 6, 10, 14, 18, 22, 26, 34, 38, 46, 50, 54, 58, 62, 74, 82, 86, 94, 98, 106, 118, 122, 134, 142, 146, 158, 162, 166, 178, 194, 202, 206, 214, 218, 226, 242, 250, 254, 262, 274, 278, 298, 302, 314, 326, 334, 338, 346, 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, 466, 478
Offset: 1

Views

Author

N. J. A. Sloane, Nov 26 2016

Keywords

Crossrefs

Twice A061345.

Programs

  • Python
    from sympy import primepi, integer_nthroot
    def A278568(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = 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+x-1-sum(primepi(integer_nthroot(x,k)[0])-1 for k in range(1,x.bit_length())))
        return bisection(f,n,n)<<1 # Chai Wah Wu, Feb 03 2025