You have an arbitrary number of model kits (which you assemble for fun and profit).
arithmetic/digits/labels
Problem
You have an arbitrary number of model kits (which you assemble for fun and profit). Each kit comes with twenty (20) stickers, two of which are labeled "0", two are labeled "1", ..., two are labeled "9". You decide to stick a serial number on each model you assemble starting with one. What is the first number you cannot stick. You may stockpile unused numbers on already assembled models, but you may not crack open a new model to get at its stickers. You complete assembling the current model before starting the next.
Show solution
The method I used for this problem involved first coming up with a
formula that says how many times a digit has been used in all n models.
n = k*10^i + m for some k,m with 0 <k <10, m < 10^i
f(d,n) = (number of d's used getting to k*10^i from digits 0 to (i-1)) +
(number of d's used by #'s 10^i to n from digit i) + f(d,m)
f(d,n) = i*k*10^(i-1) + (if (d < k) 10^i else if (d == k) m+1 else 0) + f(d,m)
This doesn't count 0's, which should be ok as they are not used as often
as other digits. From the formula, it is clear that f(1,n) is never
less than f(d,n) for 1<d<10.
So I just calculated f(1,n) for various n (with some help from bc).
I quickly discovered that for n = 2*10^15, f(1,n) = 2*n. After further
trials I determined that for n = 1999919999999981, f(1,n) = 2*n + 1.
This appears to be the smallest n with f(1,n) > 2*n.