%I #13 Feb 26 2023 02:19:15
%S 1,1,2,3,5,6,9,13,26,44,87,165,305,523,948,1792,3501,6644,12622,23334,
%T 43232,79651,149716,281278,532051,1000247,1883093,3577619,6901273,
%U 13495425,26522993,51976835
%N Number of n-digit base-2 deletable digit-sum multiple (DSM) integers.
%C 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.
%o (Python)
%o from itertools import count, islice
%o def ok(n, prevset):
%o b = bin(n)[2:]
%o if n%b.count("1"): return False
%o si = (b[:i]+b[i+1:] for i in range(len(b)))
%o return any(t[0] != '0' and int(t, 2) in prevset for t in si)
%o def agen(): # generator of terms
%o s, snxt = {1}, set()
%o for n in count(2):
%o yield len(s)
%o for i in range(2**(n-1), 2**n):
%o if ok(i, s):
%o snxt.add(i)
%o s, snxt = snxt, set()
%o print(list(islice(agen(), 20))) # _Michael S. Branicky_, Feb 25 2023
%Y Cf. A096236.
%K nonn,base,more
%O 1,3
%A _John W. Layman_, Dec 14 2004
%E a(19)-a(32) from _Michael S. Branicky_, Feb 25 2023
|