Combinatorics on numbers.

125 Views Asked by At

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?

2

There are 2 best solutions below

0
On

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$.

0
On

The number of digits when we write down all numbers till 100 is 192.

Now adding 100 more will cause total number of digits to increase by 300, as every number added was a three digit number.

Then for n=700 gives 1992 total digits Because the first 100 gives 192 and the rest of the 100s gives 300 digits. Then n=701 will have 3 more and n = 702 will have 6 more i.e will have 1998

Then n = 702 is required number and next possible will be 1998+3 = 2001.