AIME 2019 I, Problem 1

Consider the integer \[N = 9 + 99 + 999 + 9999 + \cdots + \underbrace{99\ldots 99}_\text{321 digits}.\]Find the sum of the digits of $N$.

Solution: Let's express the number in terms of $10^n$. We can obtain $(10-1)+(10^2-1)+(10^3-1)+\cdots+(10^{321}-1)$. By the commutative and associative property, we can group it into $(10+10^2+10^3+\cdots+10^{321})-321$. We know the former will yield $1111....10$, so we only have to figure out what the last few digits are. There are currently $321$ 1's. We know the last four digits are $1110$, and that the others will not be affected if we subtract $321$. If we do so, we get that $1110-321=789$. This method will remove three $1$'s, and add a $7$, $8$ and $9$. Therefore, the sum of the digits is $(321-3)+7+8+9=\fbox{342}$. -eric2020 -another Eric in 2020 A similar and simpler way to consider the initial manipulations is to observe that adding $1$ to each term results in $(10+100+... 10^{320}+10^{321})$. There are $321$ terms, so it becomes $11...0$, where there are $322$ digits in $11...0$. Then, subtract the $321$ you initially added. ~ BJHHar

Answer: 342