Q:

help confirm my answer for the following question

I was given the question:what is 9+99+999+9999+...+999..99(30 digits) After noticing a trend, I came with the conclusion that the answer would be 28 1's 080. Can anyone confirm my answer and give a reason as to why?

A:

Note that
$$\underbrace{99\cdots 9}_{k\text{ digits}} = 10^k - 1.$$
So your sum is the same as
$$(10-1) + (10^2-1) + (10^3-1) + \cdots + (10^{30}-1),$$
which is equal to 
$$(10 + 10^2 + 10^3 + \cdots + 10^{30}) - 30.$$
The first sum is easy to do, the difference is easy to do, and it gives your answer.

