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.
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, 44, 45, 46, 47, 48, 49, 60, 15, 62, 32, 34, 50, 16, 64, 52, 35, 66, 67, 68, 69, 80, 17, 82, 36, 70, 18, 84, 54, 56, 72, 37, 86, 74, 57, 88, 89, 200, 19, 201, 38, 90, 39, 202, 58
Offset: 1
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
- Paolo Xausa, Color scatterplot of the first 100000 terms
Crossrefs
Programs
-
Mathematica
A383059list[nmax_] := Module[{a, s, invQ, fu = 1}, invQ[k_] := invQ[k] = (If[#, s[k] = #]; #) & [MemberQ[Partition[IntegerDigits[k], 2, 1], {i_, j_?OddQ} /; i >= j]]; s[_] := False; s[0] = True; 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]]; A383059list[100]
-
Python
from itertools import count, islice def cond(s): return all(s[i] > s[i-1] for i in range(1, len(s)) if s[i] in "13579") def agen(): # generator of terms an, seen, s, m = 0, {0}, "0", 1 while True: yield an an = next(k for k in count(m) if k not in seen and cond(s[-1]+str(k))) seen.add(an); s += str(an) while m in seen or not cond(str(m)): m += 1 print(list(islice(agen(), 70))) # Michael S. Branicky, Apr 19 2025
Comments