# Geometric sequence - Geometric series

A geometric sequence is obtained by multiplying each term by a constant "a" :

U

_{n+1} = aU

_{n}
"a" is named the "ratio" of the geometric sequence.

For instance starting from 5 with ratio 2 :
5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, ...

The n+1^{th} term is given by

U_{n} = U_{0} × a^{n}

In previous example, the 10^{th} term is 5x2^{9}=5x512=2560.

The sum S_{n} of the n+1 first terms ("geometric series") is obtained by calculating
S_{n}-aS_{n} :

U_{0}+ U_{1} + U_{2}+....+U_{n-2}+ U_{n-1}+ U_{n}

-aU_{0}-aU_{1}-....-aU_{n-3}-aU_{n-2}-aU_{n-1}-aU_{n}

=S_{n}(1-a)=U_{0}-aU_{n}=U_{0}(1-a^{n})

S_{n} = U_{0}(1-a^{n})/(1-a)

Application : sum of powers of 3 :

It is a geometric series with ratio 3, the sum is
S_{n} = (3^{n}-1)/2.

for instance : 1+3+9+27+81+243+729+2187+6561+19683=(3^{10}-1)/2=(59049-1)/2=29524

## Convergence

If |a|<1, U

_{n+1}<U

_{n}. The terms decrease towards 0.
We may interrest in the convergence of the series, that is the sequence of S

_{n} when n grows to infinity.

If |a|<1, |a

^{n}| approaches 0 and S

_{n} approaches

S = U_{0}/(1-a)

For instance 1+1/2+1/4+1/8+...+1/2^{n} approaches 1/(1-1/2)=2