# Geometric Series/Sequence Partial Sums

Consider the geometric series defined by the sequence,

$$a_n=\frac 1 {r^n}$$, n=0,1,2,...

Then the n-th partial sum $$S_n$$ is given by

$$S_n=\sum_{k=0}^n \frac 1 {r^k}$$

I got $$\frac {1-(1/r)^n}{1-(1/r)}$$, but it was wrong.

But I used the formula I found above to find $$S_n=\sum_{k=0}^\infty \frac 1 {r^k}=\lim_{x \to \infty}S_n= \frac 1 {1-(\frac 1 r)}$$ and it worked. So I don't know what went wrong.

There are $$n + 1$$ terms in your sum, since it's from $$0$$ to $$n$$ inclusive, with the last one being $$\frac{1}{r^{n}}$$. Thus, such as shown in Geometric series, the formula uses the power of the common ratio, i.e., $$\frac{1}{r}$$ here, which is one higher than the last term uses, so the sum is actually
$$\frac{1 - \left(\frac{1}{r}\right)^{n+1}}{1 - \left(\frac{1}{r}\right)} \tag{1}\label{eq1A}$$
You can easily verify this, for example, where $$n = 0$$, then you have that
$$S_0 = \sum_{k=0}^{0}\frac{1}{r^k} = \frac{1}{r^{0}} = 1 \tag{2}\label{eq2A}$$
and \eqref{eq1A} also gives a value of $$\dfrac{1-\left(\frac{1}{r}\right)}{1-\left(\frac{1}{r}\right)} = 1$$.
$$\sum_{n=0}^k x^n=\dfrac{1-x^{k+1}}{1-x}$$. Now, if $$|x|\lt1$$, then $$x^{k+1}\to0$$, so we get $$\sum_{n=0}^{\infty}x^n=\dfrac1{1-x}$$. Thus your answer came out right.