The number of digits you have to type to write allthe page numbers of a book starting from1(first page) is 2019. What is the number of pages in that book?
Answers
If we write all the page numbers in a book starting from 1 as a single number like 123456789101112..., the no. of digits of the number thus formed is equal to 2019. Let these page nos. be written in ascending order as followed.
We have to find no. of pages of the book.
We see there are (9 - 1) + 1 = 9 one - digit numbers, so the no. of digits in our number, formed byone - digit numbers only, is equal to 1 × 9 = 9.
If we remove these numbers from our number, then our number will have 2019 - 9 = 2010 digits.
We see there are (99 - 10) + 1 = 90 two - digit numbers, so the no. of digits in our number, formed by two - digit numbers only, is equal to 2 × 90 = 180.
If we remove these numbers from our number too, then our number will have 2010 - 180 = 1830
We see there are (999 - 100) + 1 = 900 three - digit numbers in total, so the no. of digits formed by three - digit numbers only, in general, is equal to 3 × 900 = 2700.
But our number consists of 1830 digits formed by three - digit numbers only. Hence we can say the final page no. is a three digit number. Let it be
We see our number consists of three digit numbers, so the no. of digits in our number formed by three digit numbers is equal to i.e., 1830.
Hence,
Therefore the book contains pages.