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.

A378808 Numbers with monotonically decreasing digits, decreasing by only 0 or 1.

This page as a plain text file.
%I A378808 #16 Dec 18 2024 15:07:19
%S A378808 1,2,3,4,5,6,7,8,9,10,11,21,22,32,33,43,44,54,55,65,66,76,77,87,88,98,
%T A378808 99,100,110,111,210,211,221,222,321,322,332,333,432,433,443,444,543,
%U A378808 544,554,555,654,655,665,666,765,766,776,777,876,877,887,888,987,988,998,999
%N A378808 Numbers with monotonically decreasing digits, decreasing by only 0 or 1.
%e A378808 32 is a term since it has monotonically decreasing digits whose difference is at most 1.
%e A378808 33 is a term since it also has monotonically decreasing digits whose difference is at most 1.
%t A378808 Select[Range[999],SubsetQ[{0,1},-Differences[IntegerDigits[#]]] &] (* _Stefano Spezia_, Dec 08 2024 *)
%o A378808 (Python)
%o A378808 from itertools import count, islice
%o A378808 def bgen(last, d):
%o A378808     if d == 0: yield tuple(); return
%o A378808     t = (1, 9) if last == None else (max(0, last-1), last)
%o A378808     for i in range(t[0], t[1]+1): yield from ((i,)+r for r in bgen(i, d-1))
%o A378808 def agen(): # generator of terms
%o A378808     yield from (int("".join(map(str, i))) for d in count(1) for i in bgen(None, d))
%o A378808 print(list(islice(agen(), 62))) # _Michael S. Branicky_, Dec 08 2024
%Y A378808 Cf. A009996, A064222, A378775.
%K A378808 nonn,base
%O A378808 1,2
%A A378808 _Randy L. Ekl_, Dec 07 2024