1. ## Difficult Word Problem

In numbering the pages of a book, a printer used 3289 digits. How many pages were in the book, assuming that the first page in the book was number 1.

2. Hello, MATNTRNG!

There's no formula for this problem.
I had to baby-talk my way through it.

In numbering the pages of a book, a printer used 3289 digits.
How many pages were in the book, assuming
that the first page in the book was number 1?

. . $\begin{array}{cc}\text{Pages} & \text{Digits} \\ \hline
1\text{ to } 9 & 9 \\
10\text{ to }99 & 180 \\
100\text{ to }999& 2700 \\ \hline
\text{Total:} & 2889
\end{array}$

Hence: . $3289 - 2889 \:=\:400$ digits were used

. . in the first 100 four-digit numbers.

. . . . $\{1000,\:1001,\:1002,\:\hdots\:1099\}$

Therefore, the book had 1099 pages.

3. Originally Posted by Soroban

There's no formula for this problem.
I think you basically found a formula.

$\{a_n\} = 9, 180, 2700,\dots$

$a_n=9\cdot10^{n-1}\cdot n$

$\displaystyle b_n=\sum_1^n a_n$

Being lazy to derive, I looked up on OEIS (id:A033713 - OEIS Search Results)

$b_n=\frac{1}{9}\cdot(n\cdot(10^{n+1})-(n+1)\cdot10^n+1)$

So if the number of digits used is d, then we find the n such that

$b_n \le d < b_{n+1}$

and the number of pages is

$p=10^n-1+\frac{b_{n+1}-d}{n+1}$

But in fact the $b_i$ are easily recognisable

Using not-exactly-standard notation, $b_n=[n-1](8\dots8)9$ where the number of 8's is n-1.

$\{b_n\}=9,189,2889,38889,488889,\dots$

In other words, $b_n = (n-1)\cdot10^n \ \ \ +\ \ \ (10^n-10)\cdot\frac{8}{9}\ \ \ +\ \ \ 9$

So there's no need to solve for n, we can tell just by looking.

4. Wow this is amazing. Thank you for looking at this