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.

A003158 A self-generating sequence (see Comments in A003156 for the definition).

Original entry on oeis.org

2, 7, 10, 13, 18, 23, 28, 31, 34, 39, 42, 45, 50, 53, 56, 61, 66, 71, 74, 77, 82, 87, 92, 95, 98, 103, 108, 113, 116, 119, 124, 127, 130, 135, 138, 141, 146, 151, 156, 159
Offset: 1

Views

Author

Keywords

Comments

Numbers not of the form Sum_{i>=2} e_i*A001045(i), with e(i) = 0 or 1.
Indices of b in the sequence closed under a -> abc, b -> a, c -> a, starting with a(1) = a; see A092606 where a = 0, b = 2, c = 1. - Philippe Deléham, Apr 12 2004

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Python
    def A003158(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):
            c, s = n+x, bin(x)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return bisection(f,n,n)+n-1 # Chai Wah Wu, Jan 29 2025

Formula

a(n) = A003157(n) - 1 = A079523(n) + n. - Philippe Deléham, Feb 22 2004

Extensions

Definition clarified by N. J. A. Sloane, Dec 26 2020