Sub topic 8
Summing a finite GP
This chapter assumes you can find the nth term of a geometric progression (GP) as a·r^(n−1). It also assumes you are comfortable with exponents, fractions, and solving simple equations for an unknown. A GP has first term a and common ratio r, and S_n means the sum of its first n terms.
The formula and where it comes from
Write the sum out, then multiply it by r and line the terms up:
- S_n = a + ar + ar² + ... + ar^(n−1)
- r·S_n = ar + ar² + ... + ar^(n−1) + ar^n
Subtracting the second line from the first cancels every term except the first and the last:
Sn − r·Sn = a − ar^n
So S_n(1 − r) = a(1 − r^n). For r ≠ 1 this gives two equivalent forms:
- S_n = a(r^n − 1) / (r − 1), convenient when r > 1
- S_n = a(1 − r^n) / (1 − r), convenient when r < 1
Both forms give the same value. Choose the one where numerator and denominator are positive, which reduces sign errors.
If r = 1, every term equals a and the sum is simply n·a. The general formula fails here because it divides by zero.
Worked example in code
Take the GP 2, 6, 18, 54, 162. Here a = 2, r = 3, n = 5, so S_5 = 2(3⁵ − 1)/(3 − 1) = 2 · 242 / 2 = 242.
from fractions import Fraction
def gp_nth(a, r, n):
return Fraction(a) * Fraction(r) ** (n - 1)
def gp_sum(a, r, n):
r = Fraction(r)
if r == 1:
return Fraction(a) * n
return Fraction(a) * (r ** n - 1) / (r - 1)
print(gp_nth(2, 3, 5)) # 162
print(gp_sum(2, 3, 5)) # 242The code uses Fraction so that ratios such as 1/2 give exact answers instead of rounded decimals. The r == 1 branch handles the special case above.
Counting terms correctly
The most common error is an off-by-one count. The last term is ar^(n−1), but the sum formula uses r^n. If a question gives the last term l, find n first from l = ar^(n−1), then apply the formula.
Another useful form uses the last term directly: S_n = (l·r − a) / (r − 1). It saves a step when l is given.
Worked examples
Example 1: a fractional ratio
Find 1 + 1/2 + 1/4 + ... for 6 terms. Here a = 1, r = 1/2, n = 6.
S_6 = (1 − (1/2)⁶) / (1 − 1/2) = (63/64) / (1/2) = 63/32.
Example 2: a negative ratio
Find 1 − 2 + 4 − 8 + 16. Here a = 1, r = −2, n = 5.
S_5 = ((−2)⁵ − 1) / (−2 − 1) = (−33) / (−3) = 11.
Check by adding directly: 1 − 2 + 4 − 8 + 16 = 11. Keep the brackets around −2 when raising it to a power. An odd power gives a negative result and an even power a positive one.
Example 3: finding the number of terms
How many terms of 3, 6, 12, ... add up to 189? Here a = 3, r = 2.
3(2^n − 1) / (2 − 1) = 189, so 2^n − 1 = 63 and 2^n = 64, giving n = 6.
On CAT, answers like this are usually powers of 2, 3 or 10, so you can often find n by recognising 64, 243 or 1000 instead of using logarithms.
Example 4: a sum starting from a later term
To add the terms from the mth to the nth, count how many terms there are, k = n − m + 1. The first of them is ar^(m−1), so the sum is ar^(m−1)(r^k − 1)/(r − 1).
Find the sum of the 3rd to 6th terms of 2, 6, 18, .... The 3rd term is 18 and there are 4 terms, so the sum is 18(3⁴ − 1)/2 = 18 · 40 = 720. Check: 18 + 54 + 162 + 486 = 720.
An alternative is S6 − S2. This is easier when both partial sums are already known.
Useful relationships between partial sums
The sum of the first 2n terms splits into two blocks. The second block is the first block multiplied by r^n:
S2n = Sn + r^n · Sn = Sn(1 + r^n)
More generally, S(n+m) = Sn + r^n · S_m.
For example, suppose the first 3 terms of a GP add up to 7 and the first 6 add up to 63. Then 1 + r³ = 63/7 = 9, so r³ = 8 and r = 2. From a(1 + 2 + 4) = 7 we get a = 1. This avoids solving a degree-6 equation.
If r^n appears as a single unknown in a problem, solve for r^n first and treat it as one quantity.
Numbers made of repeated digits
A standard CAT pattern is a series such as 7 + 77 + 777 + ... that is not a GP itself but can be turned into one. Write each term as a multiple of a number like 99...9.
7 + 77 + 777 + ... (n terms) = (7/9)(9 + 99 + 999 + ...) = (7/9)[(10 − 1) + (100 − 1) + ... + (10^n − 1)]
The bracket is a GP sum with a = 10 and r = 10, minus n:
= (7/9)[10(10^n − 1)/9 − n] = (7/81)(10^(n+1) − 10 − 9n)
Check with n = 2: (7/81)(1000 − 10 − 18) = (7/81)(972) = 84, and 7 + 77 = 84.
Special ratios and edge cases
| Ratio | What happens to the finite sum |
|---|---|
| r = 1 | S_n = n·a; the general formula cannot be used |
| r = −1 | Terms alternate a, −a, a, ...; S_n = a for odd n and 0 for even n |
| r > 1 | Terms and sum grow fast; use (r^n − 1)/(r − 1) |
| 0 < r < 1 | Terms shrink; use (1 − r^n)/(1 − r) |
| r < 0 | Signs alternate; keep brackets around r when taking powers |
Checking by brute force
Before an exam you can test your formula against a direct sum. This also catches off-by-one errors in how you set up n.
from fractions import Fraction
def gp_sum(a, r, n):
r = Fraction(r)
if r == 1:
return Fraction(a) * n
return Fraction(a) * (r ** n - 1) / (r - 1)
def brute(a, r, n):
return sum(Fraction(a) * Fraction(r) ** k for k in range(n))
for a, r, n in [(2, 3, 5), (1, Fraction(1, 2), 6), (1, -2, 5), (4, 1, 7)]:
print(gp_sum(a, r, n) == brute(a, r, n), gp_sum(a, r, n))
# True 242
# True 63/32
# True 11
# True 28Common mistakes
- Using n instead of n − 1 as the exponent in the nth term, or n − 1 instead of n in the sum formula.
- Dropping the brackets on a negative ratio, so (−2)⁴ is computed as −16.
- Applying the formula with r = 1 and getting 0/0.
- Using the infinite-sum formula a/(1 − r) on a finite sum. The finite sum always has the r^n term.
- Forgetting that the 3rd to 6th terms number 4, not 3.
Exercise
Find the sum of the first 8 terms of the GP 5, 10, 20, ....
Show answer
a = 5, r = 2, n = 8. S_8 = 5(2^8 − 1)/(2 − 1) = 5 · 255 = 1275.
Exercise
The sum of the first 2 terms of a GP is 12 and the sum of the first 4 terms is 60. All terms are positive. Find a and r.
Show answer
S4 = S2(1 + r²), so 1 + r² = 60/12 = 5 and r² = 4. Since terms are positive, r = 2. Then a(1 + 2) = 12 gives a = 4. Check: 4 + 8 + 16 + 32 = 60.
Exercise
Find 3 + 33 + 333 + ... up to 4 terms.
Show answer
Write it as (3/9)(9 + 99 + 999 + 9999) = (1/3)(10 + 100 + 1000 + 10000 − 4) = (1/3)(11110 − 4) = 11106/3 = 3702. Check: 3 + 33 + 333 + 3333 = 3702.
Exercise
At the start of each year, Rs 5000 is deposited in an account paying 10% compound interest per year. What is the balance at the end of the 4th year?
Show answer
The deposits earn interest for 4, 3, 2 and 1 years. The balance is 5000(1.1⁴ + 1.1³ + 1.1² + 1.1), a GP with first term 5000 × 1.1, ratio 1.1, and 4 terms. S = 5500(1.1⁴ − 1)/0.1 = 5500 × 4.641 = Rs 25,525.50.