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.

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