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 A382935 #22 Apr 30 2025 11:09:50 %S A382935 0,2,1,4,3,6,5,8,7,10,20,21,22,12,14,16,18,24,26,28,30,40,41,42,43,44, %T A382935 31,46,32,48,34,36,38,50,60,61,62,63,64,65,66,51,68,52,80,81,82,83,84, %U A382935 85,86,53,87,54,88,56,58,70,200,202,100,204,102,104,106,108,71,206,120,208 %N A382935 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 A382935 Could be summarized as "odd digit, previous bigger". A variant of A342042. %C A382935 No term contains the digit 9. %H A382935 Paolo Xausa, <a href="/A382935/b382935.txt">Table of n, a(n) for n = 1..10000</a> %H A382935 Paolo Xausa, <a href="/A382935/a382935.png">Color scatterplot of the first 50000 terms</a> %t A382935 A382935list[nmax_] := Module[{a, s, invQ, fu = 1}, %t A382935 invQ[k_] := invQ[k] = (If[#, s[k] = #]; #) & [MemberQ[Partition[IntegerDigits[k], 2, 1], {i_, j_?OddQ} /; i <= j]]; %t A382935 s[_] := False; s[0] = True; %t A382935 NestList[(a = fu; While[s[a] || invQ[a] || invQ[# + First[IntegerDigits[a]]], a++] & [Max[Mod[#, 10], 1]*10]; While[s[fu], fu++]; s[a] = True; a) &, 0, nmax - 1]]; %t A382935 A382935list[100] %o A382935 (Python) %o A382935 from itertools import count, islice %o A382935 def cond(s): %o A382935 return all(s[i+1] < s[i] for i in range(len(s)-1) if s[i+1] in "13579") %o A382935 def agen(): # generator of terms %o A382935 an, seen, s, m = 0, {0}, "0", 1 %o A382935 while True: %o A382935 yield an %o A382935 an = next(k for k in count(m) if k not in seen and cond(s[-1]+str(k))) %o A382935 seen.add(an); s += str(an) %o A382935 while m in seen or not cond(str(m)): m += 1 %o A382935 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Apr 14 2025 %Y A382935 Similar sequences: A342042, A342043, A342044, A342045, A382462, A382621, A383059. %Y A382935 Cf. A382936, A382939, A383500, A383501. %K A382935 nonn,base,look %O A382935 1,2 %A A382935 _Paolo Xausa_, Apr 14 2025