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.

A382462 Lexicographically earliest sequence of distinct positive integers such that if a digit d in the digit stream (ignoring commas) is even, the previous digit is < d.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 31, 21, 23, 33, 34, 35, 36, 37, 38, 39, 51, 24, 53, 41, 25, 55, 56, 57, 58, 59, 71, 26, 73, 43, 45, 61, 27, 75, 63, 46, 77, 78, 79, 91, 28, 93, 47, 81, 29, 95, 65, 67, 83, 48, 97, 85, 68, 99, 111, 49, 112, 69
Offset: 1

Views

Author

Paolo Xausa, Mar 27 2025

Keywords

Comments

Could be summarized as "even digit, previous smaller". A variant of A342042.
No term contains the digit 0. - Paolo Xausa, Apr 30 2025

Crossrefs

Programs

  • Mathematica
    A382462list[nmax_] := Module[{a, s, invQ, fu = 2},
      invQ[k_] := invQ[k] = (If[#, s[k] = #]; #) & [MemberQ[Partition[IntegerDigits[k], 2, 1], {i_, j_?EvenQ} /; i >= j]];
      s[_] := False; s[1] = 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) &, 1, nmax-1]];
    A382462list[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 "02468")
    def agen(): # generator of terms
        an, seen, s, m = 1, {1}, "1", 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