0
$\begingroup$

Find the integer $n$ which has the following property: If the numbers from $1$ to $n$ are all written down in decimal notation the total number of digit written down is $1998$. What is the next higher number (instead of $1998$) for which this problem has an answer?

My try:

This problem was given under exercise Inclusion-Exclusion Principle, I think we should first find that $n$ for which above holds, then we'll find the number of digits (same manner as in problem) in $n+1$.

Like digits from: $\begin{cases}1-9 &=9\\ 10-99 &=2\times 90\\ 100-999 &=3\times 900\\ & \vdots\\ \end{cases}$

We can easily see the pattern above. But I don't see whether we seriously need IEP.

How to take it from here?

1 Answers 1

1

Since $3\cdot900=2700>1998$, you need to solve the equation:

$1\cdot9+2\cdot90+3\cdot{k}=1998\iff3k=1998-189\iff{k}=603$.

This means that there are $603$ numbers of $3$ digits each, hence $n=100+603-1=702$.

The next number for which this problem has an answer is of course $1998+3=2001$.