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.

A101216 Number of n-digit base-2 deletable digit-sum multiple (DSM) integers.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 9, 13, 26, 44, 87, 165, 305, 523, 948, 1792, 3501, 6644, 12622, 23334, 43232, 79651, 149716, 281278, 532051, 1000247, 1883093, 3577619, 6901273, 13495425, 26522993, 51976835
Offset: 1

Views

Author

John W. Layman, Dec 14 2004

Keywords

Comments

A positive integer n is a base-b digit-sum-multiple (DSM) number if the sum of the digits of n, in base b, divides n. It is a deletable base-b DSM if it has the property that removing some digit leaves either the empty string or another deletable base-b DSM.

Crossrefs

Cf. A096236.

Programs

  • Python
    from itertools import count, islice
    def ok(n, prevset):
        b = bin(n)[2:]
        if n%b.count("1"): return False
        si = (b[:i]+b[i+1:] for i in range(len(b)))
        return any(t[0] != '0' and int(t, 2) in prevset for t in si)
    def agen(): # generator of terms
        s, snxt = {1}, set()
        for n in count(2):
            yield len(s)
            for i in range(2**(n-1), 2**n):
                if ok(i, s):
                    snxt.add(i)
            s, snxt = snxt, set()
    print(list(islice(agen(), 20))) # Michael S. Branicky, Feb 25 2023

Extensions

a(19)-a(32) from Michael S. Branicky, Feb 25 2023