4
$\begingroup$

I have the following exponential series:

$S = ar^0 + ar^1 + ar^2 + \cdots + ar^n$

I know $S$, $r$ and $n$. How do I find $a$?

I actually need this done by a script so all "crazy" methods like doing an operation $n$ times are ok.

  • 0
    I changed the title.2011-04-15

1 Answers 1

7

As Raskolnikov points out this is a geometric series. Sum is given by $S = a \cdot \frac{r^{n+1}-1}{r-1}$

Substitute the value of $S,r,n$ to get $a$

  • 0
    @Dani: Yes, Dani because here there are $n+1$ terms. The formula which I gave was for $n$ terms.2011-04-14