Let’s see how many numbers from to don’t contain the digit .

For this kind of problem a computer scientist will most probably try to implement a sophisticated algorithm, a mathematician will try to find a direct formula, and a physicist will give an approximated value.

I’ll choose the math approach and instead of counting we can think to numbers as an array of digits. Imagine positions that can be filled with digits from to . The digits with value from the front can be ignored. For example represent actually then number .

Considering the above each of the positions can be filled with a value from to because we don’t want the digit . This means that we have ways to fill each position, resulting a total of numbers having up to digits and not containing the digit . We also counted the number because it appears when all the positions are filled with digit .