# Find a formula for Sn, the sum of the first n terms of the geometric sequence

Geometric Progression (GP) is a type of sequence where each succeeding term is produced by multiplying each preceding term by a fixed number, which is called a common ratio. This progression is also known as a geometric sequence of numbers that follow a pattern.

### Sum of n terms

Consider the G.P,

$a,ar,ar^2,…..ar^{n-1}$

Let $S_n,a,r$ be the sum of n terms, first term and ratio of the G.P respectively.

Then, $S_n$ = $a + ar + ar^2 + ⋯ + ar^{n-1}$ —(1)

There are two cases, either $r = 1$ or $r ≠ 1$ If r=1, then

$S_n$ = $a + a + a + ⋯ a$ = $na$

When $r ≠ 1$, Multiply (1) with r gives, $rS_n$

= $ar + ar^2 + ar^3 + ⋯ + ar^{n-1} + ar^n$—(2)

Subtracting (1) from (2) gives

$rS_n – S_n = (ar + ar^{2} + ar^{3} + …. + ar^{n-2} + ar^{n-1} + ar^{n}) – (a + ar + ar^{2} + …. + ar^{n-2} + ar^{n-1})$ $(r – 1) S_n = ar^{n} – a = a(r^{n}-1)$ $S_n = a\frac{(r^{n}-1)}{(r – 1)} = a\frac{(1 – r^{n})}{(1 – r )}$

Sum of n terms n = $\frac{a(r^n – 1)}{r-1}$; Where r $\neq$ 1