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.

A362371 a(0)=0. For each digit in the sequence, append the smallest unused integer that contains that digit.

Original entry on oeis.org

0, 10, 1, 20, 11, 2, 30, 12, 13, 21, 3, 40, 14, 22, 15, 23, 24, 16, 31, 4, 50, 17, 34, 25, 26, 18, 5, 27, 32, 28, 41, 19, 6, 33, 51, 42, 35, 60, 61, 7, 36, 43, 29, 45, 52, 46, 71, 8, 53, 62, 37, 38, 72, 82, 48, 44, 81, 91, 9, 56, 39, 63, 54, 100, 47, 92, 73
Offset: 0

Views

Author

Gavin Lupo, Apr 17 2023

Keywords

Examples

			a(0) =  0
a(1) = 10 (from digit 0 in a(0)=0, smallest integer other than 0).
a(2) =  1 (from digit 1 in a(1)=10, smallest integer other than 10).
a(3) = 20 (from digit 0 in a(1)=10, smallest integer other than 0 and 10).
a(4) = 11 (from digit 1 in a(2)=1, smallest integer other than 1 and 10).
a(5) =  2 (from digit 2 in a(3)=20, smallest integer other than 20).
a(6) = 30 (from digit 0 in a(3)=20, smallest integer other than 0, 10, and 20).
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        s, aset, mink = "0", set(), 0
        for n in count(0):
            an = mink
            while an in aset or set(san:=str(an)) & {s[0]} == set(): an += 1
            s = s[1:] + san
            aset.add(an)
            yield an
            while mink in aset: aset.discard(mink); mink += 1
    print(list(islice(agen(), 67))) # Michael S. Branicky, Apr 25 2023