4. Let

$$
n=9+99+999+\cdots+\underbrace{999 \ldots 999}_{99 \text { digits }}
$$

Determine the number and the sum of the digits of the number $n$.
First solution.

$n=9+99+999+\cdots+\underbrace{999 \ldots 999}_{99 \text { digits }}$

The first addend has 1 digit, the second has 2 digits, the third has 3 digits, and the last has 99 digits, so the total number of addends is 99.

$$
\begin{aligned}
& n=9+90+9+900+90+9+\ldots+9 \underbrace{00 \ldots 00}_{98 \text { zeros }}+9 \underbrace{00 \ldots 00}_{97 \text { zeros }}+\ldots+900+90+9= \\
& n=99 \cdot 9+98 \cdot 90+97 \cdot 900+96 \cdot 9000+95 \cdot 90000+\ldots+2 \cdot 9 \underbrace{00 \ldots 00}_{98 \text { zeros }}+9 \underbrace{00 \ldots 00}_{97 \text { zeros }}
\end{aligned}
$$

$99 \cdot 9=891$, the digit in the units place is 1

$98 \cdot 90+890=8820+890=9710$, the digit in the tens place is 1

$97 \cdot 900+9700=87300+9700=97000$, the digit in the hundreds place is 0

$96 \cdot 9000+97000=864000+97000=961000$, the digit in the thousands place is 1

$95 \cdot 9+96=855+96=951$, the digit in the ten thousands place is 1

$94 \cdot 9+95=94 \cdot 9+94+1=94 \cdot 10+1$, the digit in the hundred thousands place is 1

$93 \cdot 9+94=93 \cdot 9+93+1=93 \cdot 10+1$, the digit in the millions place is 1

$92 \cdot 9+93=92 \cdot 9+92+1=92 \cdot 10+1$, the digit in the ten millions place is 1

$91 \cdot 9+92=91 \cdot 9+91+1=91 \cdot 10+1$, the digit in the hundred millions place is 1

$90 \cdot 9+91=90 \cdot 9+90+1=90 \cdot 10+1$, the digit in the billions place is 1

$89 \cdot 9+90=89 \cdot 9+89+1=89 \cdot 10+1$, the digit in the ten billions place is 1

$88 \cdot 9+89=88 \cdot 9+88+1=88 \cdot 10+1$, the digit in the hundred billions place is 1

$4 \cdot 9+5=4 \cdot 9+4+1=4 \cdot 10+1$, the digit in the 96th place counting from the units place is 1

$3 \cdot 9+4=3 \cdot 9+3+1=3 \cdot 10+1$, the digit in the 97th place counting from the units place is 1

$2 \cdot 9+3=2 \cdot 9+2+1=2 \cdot 10+1$, the digit in the 98th place counting from the units place is 1

$1 \cdot 9+2=1 \cdot 9+1+1=1 \cdot 10+1=11$, the leading two places are 1s

$n=11111 . . .111111111011, n$ has 100 digits, the digit in the hundreds place is 0.

The sum of all digits is 99.