AoPS Wiki talk:Problem of the Day/July 6, 2011

Problem

AoPSWiki:Problem of the Day/July 6, 2011

Solution

Trivial Case

$n \le 9$: $\boxed {123 ... n}$

Solution

$1+11+\cdots+\underbrace{111\cdots 111}_{n}} = n + 10(n-1) + 100(n-2) + \cdots + 10^{n-1}(n-(n-1)$ (Error compiling LaTeX. Unknown error_msg). This can be expressed as the summation:

$\sum\limits_{k=0}^n 10^{k}(n-k) = n \cdot \frac{10^{n+1}-1}{9} -\sum_{k=0}^n k10^k$. Let $S = \sum_{k=0}^n k10^k$, so that $10S = \sum_{k=0}^n (k+1)10^{k+1} - 10^{k+1} = S + (n+1) \cdot 10^{n+1} - \frac{10}{9}\cdot (10^{n+1}-1)$. Thus, the answer is $n \cdot \frac{10^{n+1}-1}{9} - \frac{(n+1) 10^{n+1}}{9} + \frac{10}{81}(10^{n+1}-1) = \boxed{\frac{10^{n+1} - 9n - 10}{81}}.$