Monday, December 21, 2009

In numbering the pages of a book,a printer used 3289 digits.How many pages were in the book?start from page 1.?

Once, you find this answer can you generalize. 3289 digits used to write the page numbers of a book. start with page 1 being the first digit. 2 being the second digit and so forth until you reach 3289 digits.In numbering the pages of a book,a printer used 3289 digits.How many pages were in the book?start from page 1.?
For pages 1 to 9 --%26gt; 9 * 1 digit = 9 digits


For pages 10 to 99 --%26gt; 90 * 2 digits = 180 digits


For pages 100 to 999 --%26gt; 900 * 3 digits = 2,700 digits





So the digits used for 999 pages


9 + 180 + 2700 = 2889





The remaining pages take 4 digits per page.


3289 - 2889 = 400





400/4 = 100 pages





999 + 100 = 1099 pages





If you want to generalize this, the number of digits for pages 1000 to 9999 is given by this formula:


f(x) = 2889 + 4(x - 999)


f(x) = 4x + 2889 - 3996


f(x) = 4x - 1107In numbering the pages of a book,a printer used 3289 digits.How many pages were in the book?start from page 1.?
D(n) is number of digits used for the first n pages.


then D(n+1) = D(n) + ceil(Log(n+1))


solve D(n) and you are done...

No comments:

Post a Comment