[ Geometric progression ]

Find the sum a) 1+11+111+...+111...1, where the last number contains $\mathbf{n}$ ones; b) a similar problem, where fives are used instead of ones.
Solve a similar problem where ones are replaced by nines.

## Solution

The problem is easiest to solve when ones are replaced by nines. Using the formula for the sum of a geometric progression, we find the sum \( S = 9 + 99 + 999 + \ldots + 999 \ldots 9 \) (n nines) \( = (10^1 - 1) + (10^2 - 1) + \ldots + (10^n - 1) = (10^1 + 10^2 + \ldots + 10^n) - n = (10^{n+1} - 10) / (10 - 1) - n = (10^n - 1) * (10 / 9) - n \).

a) Now it is easy to answer the question of this part: the sum is \( S / 9 = (10^n - 1) * (10 / 81) - n / 9 \).

b) In this case, the answer is \( (S / 9) * 5 = (10^n - 1) * (50 / 81) - 5n / 9 \).