From the first term and the common difference, finds the nth term a + (n−1)d of an arithmetic sequence and the sum of the first n terms.
Explanation
In an arithmetic sequence, every term sits a fixed distance from the one before it. That distance is the common difference. Given the first term, the difference and a term number, you can get both the nth term and the running total up to it.
an=a+(n−1)d Sn=2n(a+an) - a — the first term
- d — the common difference, added at each step
- n — which term you want, an integer of 1 or more
- an — the nth term
- Sn — the sum of the first n terms
Note the n−1. Reaching the nth term takes n−1 steps, not n, because you start out already standing on the first term. That off-by-one is the classic trap.
Example
Start with a=3, d=4 and n=10. The sequence runs 3, 7, 11, 15, and so on.
a10=3+(10−1)×4=3+36=39 S10=210×(3+39)=2420=210 The tenth term is 39, and the first ten terms add to 210.
Notes
- n has to be a whole number of 1 or more. Fractions and non-positive values are rejected.
- The common difference may be negative, in which case the terms shrink as the sequence goes on.
- Read the sum formula as (first term + last term) times the number of terms, all halved. You are averaging the two ends and multiplying by how many terms there are.
- Why it works: write the sequence forwards, write it again backwards underneath, and add column by column. Every column totals first term plus last term, and there are n columns.