A101216 Number of n-digit base-2 deletable digit-sum multiple (DSM) integers.
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
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
Comments