# Geometric sequence

A geometric sequence is a sequence of numbers in which each term is a fixed multiple of the previous term. For example: 1, 2, 4, 8, 16, 32, ... is a geometric sequence because each term is twice the previous term. In this case, 2 is called the common ratio of the sequence. More formally, a geometric sequence may be defined recursively by:

$a_n = r\cdot a_{n-1}, n > 1$

with a fixed first term $a_1$ and common ratio $r$. Using this definition, the $n$th term has the closed-form:

$a_n = a_1\cdot r^{n-1}$

## Summing a Geometric Sequence

The sum of the first $n$ terms of a geometric sequence is given by

$S_n = a_1 + a_2 + \ldots + a_n = a_1\cdot\frac{r^n-1}{r-1}$

where $a_1$ is the first term in the sequence, and $r$ is the common ratio.

### Proof

The geometric sequence can be rewritten as $a_1+r \cdot a_1+r^2 \cdot a_1+ \ldots + r^{n-1} \cdot a_1=a_1(1+r+r^2+ \ldots +r^{n-1})$ where $n$ is the amount of terms, $r$ is the common ratio, and $a_1$ is the first term. Multiplying in $(r-1)$ yields $r^n-1$ so $a_1 + a_2 + \ldots + a_n = a_1\cdot\frac{r^n-1}{r-1}$.

## Infinite Geometric Sequences

An infinite geometric sequence is a geometric sequence with an infinite number of terms. If the common ratio is small, the terms will approach 0 and the sum of the terms will approach a fixed limit. In this case, "small" means $|r|<1$. We say that the sum of the terms of this sequence is a convergent sum.

For instance, the series $1 + \frac12 + \frac14 + \frac18 + \cdots$, sums to 2. The general formula for the sum of such a sequence is:

$S = \frac{a_1}{1-r}$.

Where $a_1$ is the first term in the sequence, and $r$ is the common ratio.

### Proof

Let the sequence be

$S=a_1+a_1r+a_1r^2+a_1r^3+\cdots$

Multiplying by $r$ yields,

$S \cdot r=a_1r+a_1r^2+a_1r^3+\cdots$

We subtract these two equations to obtain:

$S-Sr=a_1$

There is only one term on the RHS because the rest of the terms cancel out after subtraction. Finally, we can factor and divide to get

$S(1-r)=a_1$

thus,

$S=\frac{a_1}{1-r}$

This method of multiplying the sequence and subtracting equations, called telescoping, is a frequently used method to evaluate infinite sequences. In fact, the same method can be used to calculate the sum of a finite geometric sequence (given above).

One common instance of summing infinite geometric sequences is the decimal expansion of most rational numbers. For instance, $0.33333\ldots = \frac 3{10} + \frac3{100} + \frac3{1000} + \frac3{10000} + \ldots$ has first term $a_0 = \frac 3{10}$ and common ratio $\frac1{10}$, so the infinite sum has value $S = \frac{\frac3{10}}{1-\frac1{10}} = \frac13$, just as we would have expected.