login
Create a histogram of the digits used so far in the sequence. Add to the last element of the sequence the least used digit on the histogram. If two or more digits have the same score in the histogram, add the smallest. 0 is to be interpreted as 10 and so comes after 9. So if 0 is the digit to add, add 10 instead. Start the sequence with 0.
2

%I #11 Oct 02 2024 04:20:08

%S 0,1,3,5,7,9,11,13,15,17,19,21,25,29,33,37,41,47,53,59,65,73,81,87,93,

%T 99,105,111,117,123,129,135,141,147,153,159,165,171,177,183,189,195,

%U 201,207,213,219,225,231,237,243,249,255,261,267,273,279,285,291,297,303

%N Create a histogram of the digits used so far in the sequence. Add to the last element of the sequence the least used digit on the histogram. If two or more digits have the same score in the histogram, add the smallest. 0 is to be interpreted as 10 and so comes after 9. So if 0 is the digit to add, add 10 instead. Start the sequence with 0.

%C a(135) = a(134) + 10 = 821 is the first time 10 is added. - _Michael S. Branicky_, Oct 01 2024

%H Michael S. Branicky, <a href="/A093031/b093031.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o from itertools import islice

%o from collections import Counter

%o def agen(): # generator of terms

%o an, c = 0, Counter()

%o while True:

%o yield an

%o c.update(list(str(an)))

%o m, argm = float('inf'), None

%o for d in "1234567890":

%o if c[d] < m:

%o m, argm = c[d], d

%o an += 10 if argm == "0" else int(argm)

%o print(list(islice(agen(), 60))) # _Michael S. Branicky_, Oct 01 2024

%K nonn,base

%O 1,3

%A _Eric Angelini_, May 07 2004

%E Offset changed to 1 by _Michael S. Branicky_, Oct 01 2024