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?
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?
Hint
$$\sum_{k=0}^n x^k=\frac{1-x^{n+1}}{1-x}.$$