Sum of the first n terms of an AP
A famous schoolboy story claims that when young Gauss was asked to add 1+2+3+…+100, he wrote 5050 within seconds. His trick , pair the first and last terms, then the second and second-last, and so on , gives the formula we need.
For an AP with first term a, common difference d, and n terms, the sum of the first n terms is
Sn=2n[2a+(n−1)d].
Equivalently, if the last term is ℓ=a+(n−1)d,
Sn=2n(a+ℓ).
Derivation (Gauss trick)
Write the sum forwards and backwards:
Sn=a+(a+d)+(a+2d)+…+ℓ,
Sn=ℓ+(ℓ−d)+(ℓ−2d)+…+a.
Add term by term:
2Sn=(a+ℓ)+(a+ℓ)+…+(a+ℓ)=n(a+ℓ).
So Sn=2n(a+ℓ).
Substituting ℓ=a+(n−1)d gives the equivalent formula
Sn=2n[2a+(n−1)d].
- Sn=2n(a+ℓ): ideal when a and ℓ are given (and so we just need n).
- Sn=2n[2a+(n−1)d]: ideal when a and d are given (so we don't have to compute the last term first).
Both are equivalent , choose whichever leads to less arithmetic.
A useful corollary: the nth term and the sum are linked by
an=Sn−Sn−1.
This is occasionally handy: if you are given the sum formula and need the nth term, just subtract.
Worked examples
Example 1. Sum of the first 30 terms of 5,9,13,17,….
a=5,d=4,n=30. S30=230[2⋅5+29⋅4]=15⋅[10+116]=15⋅126=1890.
Example 2. Find the sum of the first 50 natural numbers.
1+2+…+50=250(1+50)=25⋅51=1275.
Example 3. Find the sum of all two-digit multiples of 3.
Two-digit multiples of 3: 12,15,…,99. AP with a=12,d=3.
Number of terms: a+(n−1)d=99⇒12+3(n−1)=99⇒n=30.
Sum =230(12+99)=15⋅111=1665.
Example 4. How many terms of the AP 9,17,25,… are required to give a sum of 636?
a=9,d=8. Sn=2n[18+8(n−1)]=2n(8n+10)=n(4n+5).
Set 4n2+5n=636⇒4n2+5n−636=0. Discriminant =25+10176=10201=1012. n=(−5+101)/8=12.
Example 5. The sum of the first n terms of an AP is 4n2+5n. Find the nth term.
an=Sn−Sn−1=(4n2+5n)−(4(n−1)2+5(n−1))=(4n2+5n)−(4n2−8n+4+5n−5)=(4n2+5n)−(4n2−3n−1)=8n+1.
So an=8n+1, an AP with a=9,d=8. (And indeed S1=a1=9; check S1=4+5=9 ✓.)
Try it yourself
- Find S15 for 1,4,7,10,….
- Find the sum of first 100 positive integers.
- Sum of all odd numbers from 1 to 99.
- Sum of all multiples of 7 between 1 and 100.
- The sum of the first n terms of an AP is 3n2+2n. Find the AP.
- If Sn for an AP is 2n(3n+5), find the AP.
- How many terms of the AP 24,21,18,… must be taken so that the sum is 78?
- Find the sum of all three-digit numbers divisible by 9.
- The first term of an AP is 5, the last term is 45, and the sum is 400. Find the number of terms and the common difference.
- A man arranges to pay a debt of ₹3600 by 40 instalments which form an AP. When 30 instalments are paid he dies, leaving one-third of the debt unpaid. Find the value of the first instalment.
Pitfalls / Insight
- Don't forget the n/2 in front. The most common error is writing Sn=2a+(n−1)d (missing the multiplier).
- For "how many terms", the quadratic in n should give a positive integer , reject negatives or fractions.
- For "sum of all multiples" in a range, first identify the AP, then count terms, then sum.
Insight. Once you have a and d, both the nth term and the sum are one-line computations. Spend your effort getting a and d from the problem; the rest is arithmetic.