$$\sum_{k=1}^n k*10^{k-1}$$
I came across this summation of series while I was trying to solve Project Euler Problem 40. The problem can be solved without using this method; however, I want to know how to evaluate this summation to a formula. It gives 1, 21, 321, 4321, ... for n=1,2,3,4, ... $$\frac{10^n(9n-1)+1}{81}$$ I also obtained the formula by using symsum() function of Matlab, but I do not know how to evaluate it.
$$S(n)=\sum_{k=1}^n k10^{k-1}$$
$$=-(n+1)10^{n}+1+\sum_{k=1}^{n} (k+1)10^{k}$$
$$=-(n+1)10^n+1+\sum_{k=1}^{n} k10^k+\sum_{k=1}^{n} {10^k}$$
$$=-(n+1)10^n+1+10S(n)+\frac{10^{n+1}-1}{9}-1$$
Thus,
$$-9S(n)=-(n+1)10^n+1+\frac{10^{n+1}-1}{9}-1$$
$$S(n)=\frac{(n+1)10^n}{9}-\frac{10^{n+1}-1}{81}$$
$$=\frac{10^n(9n-1)+1}{81}$$