# How to derive the formula of the sum of this finite series: $\sum_{n=M}^N a^n$

I would like to know how to arrive at the following result that my teacher wrote on the board. They did not explain how it was done. I am also not sure what this series is called. Is it perhaps a power series?

$$N>M :\sum_{n=M}^N a^n = \frac{a^M-a^1a^n}{1-a},a\neq1$$ $$N>M: \sum_{n=M}^N a^n = N-M+1,a=1$$

I am quite lost since my teacher only wrote the above formulae without any derivation. Can someone help me understand why they are true? Thank you!

• Looks like an application of geometric series, i.e. $\sum_{i=0}^n a^i = \frac{1-a^{n+1}}{1-a}$. – TrostAft Dec 6 at 16:01

$$\sum_{n=M}^N a^n =\sum_{n=0}^N a^n-\sum_{n=0}^{M-1} a^n$$
$$\sum_{n=M}^N 1$$
• @DvirIhie But form $5$ to $8$ is like $0$ to $8$ minus $0$ to $4$, that's what I wrote. – gimusi Dec 6 at 16:16