OFFSET
1,1
COMMENTS
Consider an initially empty set of digits whose digits are used to create a given number where each time a number is created those digits are removed from the set. If a number cannot be created as all its required digits are not currently in the set then all the digits of that number are instead added to the set. Start by trying to create the number 0 followed by all other integers. This sequence list the numbers that are created.
For the first 10 million terms the largest gap between terms is 7, between a(38984) = 77978 and a(38985) = 77985. No other gap of 7 or larger is present. The 10 millionth term is created after the addition of the number 20000017. The fact this is almost twice the number of terms implies that this ratio approaches two as n goes to infinity. After the 10 millionth term the number of digits, from 0 to 9, in the set is 2,2,4,0,10,0,8,0,11,11.
This sequence was inspired by the 'Bag of digits' post given in the links.
LINKS
Jonathan Stauduhar, Bag of digits, SeqFan Mailing List, Dec 10 2019.
EXAMPLE
a(1) = 10 as the first ten numbers 0 to 9 had to be added to the set as none of their digits were currently in the set. The number 10 is the first number whose digits, 0 and 1, were in the set. After this number the set now contains 2,3,4,5,6,7,8,9.
a(2) = 12 as the previous number 11 was unable to be created as the set contained no 1's, so those two 1's were added to the set. This allowed 12 to be created, after which the set contains 1,3,4,5,6,7,8,9.
a(3) = 13 as the set contained both a 1 and 3, so 13 could be created. After this the set contains 4,5,6,7,8,9.
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Jan 13 2020
STATUS
approved