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.

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.

Original entry on oeis.org

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, 31, 46, 32, 48, 34, 36, 38, 50, 60, 61, 62, 63, 64, 65, 66, 51, 68, 52, 80, 81, 82, 83, 84, 85, 86, 53, 87, 54, 88, 56, 58, 70, 200, 202, 100, 204, 102, 104, 106, 108, 71, 206, 120, 208
Offset: 1

Views

Author

Paolo Xausa, Apr 14 2025

Keywords

Comments

Could be summarized as "odd digit, previous bigger". A variant of A342042.
No term contains the digit 9.

Crossrefs

Programs

  • Mathematica
    A382935list[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++] & [Max[Mod[#, 10], 1]*10]; While[s[fu], fu++]; s[a] = True; a) &, 0, nmax - 1]];
    A382935list[100]
  • Python
    from itertools import count, islice
    def cond(s):
        return all(s[i+1] < s[i] for i in range(len(s)-1) if s[i+1] 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 14 2025