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.

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?
. .
Hence: .digits were used
. . in the first 100 four-digit numbers.
. . . .
Therefore, the book had 1099 pages.
I think you basically found a formula.
Being lazy to derive, I looked up on OEIS (id:A033713 - OEIS Search Results)
So if the number of digits used is d, then we find the n such that
and the number of pages is
But in fact theare easily recognisable
Using not-exactly-standard notation,where the number of 8's is n-1.
In other words,
So there's no need to solve for n, we can tell just by looking.