## 23. Parisians

In Paris, there are 2,754,842 people. Each of them is assigned a specific number - from 1 to 2,754,842. How many digits are needed to write all these numbers, what is the sum of all these numbers, and what is the sum of all the digits that make up all these numbers?
23. I. Let's determine the number $N_{1}$ of required digits:
1) for writing
2) " "
3) " "
4) " "
5) " "
6) " "
7) " "

![](https://cdn.mathpix.com/cropped/2024_05_21_fe999c0fe2ad81fc5164g-214.jpg?height=315&width=729&top_left_y=525&top_left_x=652)

![](https://cdn.mathpix.com/cropped/2024_05_21_fe999c0fe2ad81fc5164g-214.jpg?height=315&width=325&top_left_y=525&top_left_x=1371)

Thus,

$$
N_{i}=18172790
$$

II. Let's find the sum $N_{2}$ of all numbers:

$$
\begin{aligned} \(1+2754842 & =2754843 \\ 2+2754841 & =2754843 \\ 3+2754840 & =2754843 \\\)\hline \(1377421+1377422 & =2754843\end{aligned}
$$\)

In the end, we get

$$
N_{2}=1377421 \cdot 2754843 \approx 3794736 \text { million }
$$

III. Finally, let's determine the sum $N_{3}$ of all used digits.

We will only briefly outline the solution to this more complex problem. Let $(n \rightarrow N)$ be the sum of the digits of all natural numbers between

A) By induction, it can be proven that

$$
\left[1 \rightarrow\left(10^{n}-1\right)\right]=n \cdot 45 \cdot 10^{n-1}
$$

B) By breaking down into separate "blocks" and summing the results, the formula is derived as

$$
\left[1 \rightarrow\left(p 10^{n}-1\right)\right]=(p / 2) \cdot 10^{n} \cdot(9 n+p-1)
$$

therefore

$$
\left(1 \rightarrow p 10^{n}\right)=(p / 2) \cdot 10^{n}(9 n+p-1)+p
$$

Applying all of this to our problem, we get

| Interval | Application of formula | Additional additions, generated by constant digits |
| :---: | ---: | :--- |
|  |  |  |
| $1-2000000$ | 55000002 |  |
| $2000001-2700000$ | 17850007 | $2 \cdot 700$ 000 |
| $2700001-2750000$ | 1000005 | $(2+7) \cdot 50000$ |
| $2750001-2754000$ | 60001 | $(2+7+5) \cdot 4000$ |
| $2754001-2754800$ | 10008 | $(2+7+5+4) \cdot 800$ |
| $2754801-2754840$ | 244 | $(2+7+5+4+8) \cdot 40$ |
| $2754841-2754842$ | 3 | $(2+7+5+4+8+4) \cdot 2$ |

In the end, we get

$$
N_{3}=75841773
$$

This solution belongs to the readers of "Modern Values."