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.
%I A383059 #9 Apr 19 2025 18:02:13 %S A383059 0,1,2,3,4,5,6,7,8,9,20,10,12,22,23,24,25,26,27,28,29,40,13,42,30,14, %T A383059 44,45,46,47,48,49,60,15,62,32,34,50,16,64,52,35,66,67,68,69,80,17,82, %U A383059 36,70,18,84,54,56,72,37,86,74,57,88,89,200,19,201,38,90,39,202,58 %N A383059 Lexicographically earliest sequence of distinct nonnegative integers such that if a digit d in the digit stream (ignoring commas) is odd, the previous digit is < d. %C A383059 Could be summarized as "odd digit, previous smaller". A variant of A342042. %H A383059 Paolo Xausa, <a href="/A383059/b383059.txt">Table of n, a(n) for n = 1..10000</a> %H A383059 Paolo Xausa, <a href="/A383059/a383059.png">Color scatterplot of the first 100000 terms</a> %t A383059 A383059list[nmax_] := Module[{a, s, invQ, fu = 1}, %t A383059 invQ[k_] := invQ[k] = (If[#, s[k] = #]; #) & [MemberQ[Partition[IntegerDigits[k], 2, 1], {i_, j_?OddQ} /; i >= j]]; %t A383059 s[_] := False; s[0] = True; %t A383059 NestList[(a = fu; While[s[a] || invQ[a] || invQ[# + First[IntegerDigits[a]]], a++] & [Mod[#, 10]*10]; While[s[fu], fu++]; s[a] = True; a) &, 0, nmax - 1]]; %t A383059 A383059list[100] %o A383059 (Python) %o A383059 from itertools import count, islice %o A383059 def cond(s): %o A383059 return all(s[i] > s[i-1] for i in range(1, len(s)) if s[i] in "13579") %o A383059 def agen(): # generator of terms %o A383059 an, seen, s, m = 0, {0}, "0", 1 %o A383059 while True: %o A383059 yield an %o A383059 an = next(k for k in count(m) if k not in seen and cond(s[-1]+str(k))) %o A383059 seen.add(an); s += str(an) %o A383059 while m in seen or not cond(str(m)): m += 1 %o A383059 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Apr 19 2025 %Y A383059 Similar sequences: A342042, A342043, A342044, A342045, A382462, A382621, A382935. %Y A383059 Cf. A383060, A383061, A383062, A383063. %K A383059 nonn,base,look %O A383059 1,3 %A A383059 _Paolo Xausa_, Apr 18 2025