## 51. Congratulations from Methuselah

Every New Year, starting from the first year of our era, Methuselah, who is still alive to this day, sends a greeting to his best friend, who, naturally, has changed many times over the centuries and decades. However, the formula for the greeting, on the contrary, has remained unchanged for almost two millennia. It is very simple: "Happy New Year 1", "Happy New Year 2", "Happy New Year 3", and so on, "Happy New Year 1978" and finally, "Happy New Year 1979".

Which digit has Methuselah used the least so far?
51. From the 1st to the 999th year, all digits were used an equal number of times, except for 0 (all digits were used exactly the same number of times if the first years were recorded by Methuselah as: year 0001, year 0002, ..., year 0999; however, since he did not do this, the digit 0 was used 111 times less frequently than the others). For similar reasons, in the records from 1000 to 1999, all digits appear the same number of times, except for 1 (the digit 1 is used here 1000 times more frequently than the others). But we are only considering the series of years ending in 1979. The years 1980, 1981, 1982, ..., 1999 remain. In this new series, the digit 9 appears most frequently (31 times). But this shortage of nines due to the "discarded" series is much less significant than the shortage of 0 in the first 1000 numbers.

Thus, Methuselah used the digit 0 the least frequently (and, obviously, the digit 1 the most frequently).