Is there any way to express $\sum_{i=1}^{n} i * 10^{i-1}$ without sum?

103 Views Asked by At

I would like to compute the following sum with big values of n :

$$\sum_{i=1}^{n} i * 10^{i-1}$$

I'm wondering if there is a way to express it in a manner that is faster to evaluate.

In other words, can this sum be simplified?

3

There are 3 best solutions below

1
On BEST ANSWER

Hint

$$\sum_{k=0}^n x^k=\frac{1-x^{n+1}}{1-x}.$$

2
On

$$\sum_{k=0}^n x^k=\frac{x^{n+1}-1}{x-1}.$$\

$$\sum_{k=0}^n kx^{k-1}=\frac{d}{dx}\frac{x^{n+1}-1}{x-1}=\frac{(n+1)x^n}{x-1}-\frac{x^{n+1}-1}{(x-1)^2}=\frac{nx^{n+1}-(n+1)x^n+1}{(x-1)^2}.$$

0
On

This can be a way of expressing it without sum:

$$\begin{align}\sum_{i=1}^{2} i \times 10^{i-1}&=21\\ \sum_{i=1}^{3} i \times 10^{i-1}&=321\\ \sum_{i=1}^{4} i \times 10^{i-1}&=4321\end{align}\\\vdots\\\sum_{i=1}^{n} i \times 10^{i-1}=n...321$$