John was bored and decided to write down the numbers from to . How many has he written?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
If the number of zeroes occurring at 10^k place till a particular number N is:
min(10^k * floor(N/10^(k+1)),N mod 10^(K+1))+(10^k-1) * floor(N/10^(k+1)))
Hence the answer is (adding the number of times zero occurs in places 10^0, 10^1, 10^2, 10^3 and 10^4):
22222 + 2222 * 10 + 222 * 100 + 22 * 1000 + 2 * 10000=108642