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.

This page as a plain text file.
%I A362371 #34 Apr 27 2023 09:10:58
%S A362371 0,10,1,20,11,2,30,12,13,21,3,40,14,22,15,23,24,16,31,4,50,17,34,25,
%T A362371 26,18,5,27,32,28,41,19,6,33,51,42,35,60,61,7,36,43,29,45,52,46,71,8,
%U A362371 53,62,37,38,72,82,48,44,81,91,9,56,39,63,54,100,47,92,73
%N A362371 a(0)=0. For each digit in the sequence, append the smallest unused integer that contains that digit.
%H A362371 Gavin Lupo, <a href="/A362371/a362371.png">Image of the first 10000 terms</a>
%e A362371 a(0) =  0
%e A362371 a(1) = 10 (from digit 0 in a(0)=0, smallest integer other than 0).
%e A362371 a(2) =  1 (from digit 1 in a(1)=10, smallest integer other than 10).
%e A362371 a(3) = 20 (from digit 0 in a(1)=10, smallest integer other than 0 and 10).
%e A362371 a(4) = 11 (from digit 1 in a(2)=1, smallest integer other than 1 and 10).
%e A362371 a(5) =  2 (from digit 2 in a(3)=20, smallest integer other than 20).
%e A362371 a(6) = 30 (from digit 0 in a(3)=20, smallest integer other than 0, 10, and 20).
%o A362371 (Python)
%o A362371 from itertools import count, islice
%o A362371 def agen(): # generator of terms
%o A362371     s, aset, mink = "0", set(), 0
%o A362371     for n in count(0):
%o A362371         an = mink
%o A362371         while an in aset or set(san:=str(an)) & {s[0]} == set(): an += 1
%o A362371         s = s[1:] + san
%o A362371         aset.add(an)
%o A362371         yield an
%o A362371         while mink in aset: aset.discard(mink); mink += 1
%o A362371 print(list(islice(agen(), 67))) # _Michael S. Branicky_, Apr 25 2023
%Y A362371 Cf. A000002, A107353, A339853.
%K A362371 nonn,base
%O A362371 0,2
%A A362371 _Gavin Lupo_, Apr 17 2023