Geometric sequence

A geometric sequence is a (finite or infinite) sequence of (real or complex) numbers such that the quotient of consecutive elements is the same for every pair.

Examples for geometric sequences are


 * $$ 3, 6, 12, 24, 48, 96           $$ (finite, length 6: 6 elements, quotient 2)


 * $$ 1, -2, 4, -8                   $$ (finite, length 4: 4 elements, quotient &minus;2)

\dots {1\over2^{n-4}}, \dots $$ (infinite, quotient $$1\over2$$)
 * $$ 8, 4, 2, 1, {1\over2}, {1\over4}, {1\over8},

Mathematical notation
A finite sequence
 * $$ a_1,a_2,\dots,a_n = \{ a_i \mid i=1,\dots,n \}

= \{ a_i \}_{i=1,\dots,n} $$ or an infinite sequence
 * $$ a_0,a_1,a_2,\dots = \{ a_i \mid i\in\mathbb N \}

= \{ a_i \}_{i\in\mathbb N} $$ is called geometric sequence if
 * $$ { a_{i+1} \over a_i } = q $$

for all indices i. (The indices need not start at 0 or 1.)

General form
Thus, the elements of a geometric sequence can be written as
 * $$ a_i = a_1 q^{i-1} $$

Sum
The sum (of the elements) of a finite geometric sequence is
 * $$ a_1 + a_2 +\cdots+ a_n = \sum_{i=1}^n a_i

= a_1 ( 1+q+q^2+ \cdots +q^{i-1} ) = a_1 { 1-q^i \over 1-q } $$

The sum of an infinite geometric sequence is a geometric series:
 * $$ \sum_{i=0}^\infty a_0 q^i = a_0 { 1 \over 1-q }

\qquad (\textrm {for}\ |q|<1) $$