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.

A378949 Numbers with monotonically increasing digits, increasing by only 0 or 1.

This page as a plain text file.
%I A378949 #21 Jan 19 2025 00:36:36
%S A378949 1,2,3,4,5,6,7,8,9,11,12,22,23,33,34,44,45,55,56,66,67,77,78,88,89,99,
%T A378949 111,112,122,123,222,223,233,234,333,334,344,345,444,445,455,456,555,
%U A378949 556,566,567,666,667,677,678,777,778,788,789,888,889,899,999
%N A378949 Numbers with monotonically increasing digits, increasing by only 0 or 1.
%H A378949 Robert Israel, <a href="/A378949/b378949.txt">Table of n, a(n) for n = 1..10000</a>
%e A378949 33 is a term since the digits are monotonically increasing and their difference is 0.
%e A378949 34 is also a term since the digits are monotonically increasing and their difference is 1.
%e A378949 35 is not a term since the difference in consecutive digits is not 0 or 1.
%e A378949 32 is not a term since the digits are decreasing.
%p A378949 extend:= proc(k) local m,d;
%p A378949   m:= 10^ilog10(k);
%p A378949   d:= floor(k/m);
%p A378949   if d = 1 then 10*m+k else (d-1)*10*m+k, d*10*m+k fi
%p A378949 end proc:
%p A378949 R:= $1..9:
%p A378949 A:= [R]:
%p A378949 for i from 2 to 5 do
%p A378949   A:= map(extend,A);
%p A378949   R:= R, op(sort(A));
%p A378949 od:
%p A378949 R; # _Robert Israel_, Jan 18 2025
%t A378949 Select[Range[1000],SubsetQ[{0, 1}, Union@ Differences@ IntegerDigits[#]] &] (* _James C. McMahon_, Dec 21 2024 *)
%o A378949 (Python)
%o A378949 from itertools import count, islice
%o A378949 def bgen(last, d):
%o A378949     if d == 0: yield tuple(); return
%o A378949     t = (1, 9) if last == None else (last, min(last+1, 9))
%o A378949     for i in range(t[0], t[1]+1): yield from ((i, )+r for r in bgen(i, d-1))
%o A378949 def agen(): # generator of terms
%o A378949     yield from (int("".join(map(str, i))) for d in count(1) for i in bgen(None, d))
%o A378949 print(list(islice(agen(), 62))) # _Michael S. Branicky_, Dec 18 2024
%Y A378949 Cf. A378808, A378774.
%K A378949 nonn,base
%O A378949 1,2
%A A378949 _Randy L. Ekl_, Dec 18 2024
%E A378949 Offset corrected by _James C. McMahon_, Dec 21 2024