How it works
In a geometric sequence every term is the previous term times a fixed ratio. The nth term is the first term times the ratio to the power n minus one. The sum uses the closed form so long sequences are fast. If the ratio is 1, every term equals a.
Formula
sum = a × (r^n − 1)/(r − 1) (r not 1; sum = a × n if r = 1)
Sources
Example
a = 3, r = 2, n = 8. a8 = 3 × 2^7 = 384. Sum = 3 × (256 − 1) ÷ 1 = 765. Check by adding the terms 3 + 6 + 12 + 24 + 48 + 96 + 192 + 384 = 765.
Frequently asked questions
Can the ratio be negative?
Yes. The terms then alternate in sign.
When does an infinite sum exist?
Only when |r| < 1. Then S = a ÷ (1 − r).
How is it different from an arithmetic sequence?
An arithmetic sequence adds a constant. A geometric one multiplies by a constant.
What if r = 1?
All terms equal a.