# Intro to Discrete Math: compound interest calculation

The following is from an intro to discrete mathematics page. It's on compound interest. http://www.cs.odu.edu/~toida/nerzic/content/intro2discrete/intro2discrete.html[1]

Scroll to the part with the bolded algebraic equations.

I understand the formula:

$$S = A(1 + R) + A(1 + R)^2 + ... + A(1 + R)^n$$

But what does this mean:

As well known, this S can be put into a more compact form by first computing $S - (1 + R)S$ as

$$S = A ( (1 + R)^{n + 1} - (1 + R) ) / R$$

I have no idea what $S - (1 + R)S$ or where it's gotten from.

This is from the geometric sum: $$1 + r + r^2 + r^3 + \cdots r^n = \frac{1-r^{n+1}}{1-r}$$ To see this, calculate $(1 + r + r^2 + r^3 + \cdots r^n)(1-r)$ Apply it this way: $$A(1+R) + A(1+R)^2 + \cdots A(1+R)^n = A(1+R)[1 + (1+R) + \cdots + (1+R)^{n-1}] = A(1+R)\frac{1 - (1+R)^n}{1-(1+R)}$$