Formula for finite power series
Are there any formula for result of following power series? $$0\leq q\leq 1$$ $$ \sum_{n=a}^b q^n $$
Solution 1:
Yes, consider the following manipulation: $$ S = \sum_{n=a}^b q^n = q^a + q^{a+1} + \cdots + q^b = q^a + q(q^a + a^{a+1} + \cdots + q^{b-1}) = q^a + q(S-q^b). $$ Solving this we find that .... $$ S = \frac{q^a-q^{b+1}}{1-q} $$
Solution 2:
Yes. $$ \sum_{n = a}^{b} q^{n} = \sum_{n = 0}^{b} q^{n} - \sum_{n = 0}^{a-1} q^{n}. $$ Now, if $M$ is either $a-1$ or $b$, and if $q<1$ then $$ \sum_{n=0}^{M} q^{n} = {1 - q^{M+1} \over 1 - q} $$ The last formula is explained here: https://en.wikipedia.org/wiki/Geometric_series#Formula
And if $q=1$, then $q^{n} = 1$ for all $n$.