Sequence Calculator
Result
Nth term
- Sum
- 210.000000
- Nth term formula
- a(n) = 3 + 4(n - 1)
A sequence is a list of numbers built by a single rule, and this sequence calculator covers the two rules that come up almost everywhere: an arithmetic sequence, where you add the same amount at every step, and a geometric sequence, where you multiply by the same amount instead. Give it the first term, that step, and how many terms you want, and it returns the nth term, the sum of the first n terms, and the formula the whole sequence is built from. The first term can be zero or negative, and so can the step — which is how the same three boxes cover a sequence that climbs, one that falls, and one that alternates between two values.
3, 7, 11, … — the first eight terms with the running total beside them
| n | Term | Running sum |
|---|---|---|
| 1 | 3 | 3 |
| 2 | 7 | 10 |
| 3 | 11 | 21 |
| 4 | 15 | 36 |
| 5 | 19 | 55 |
| 6 | 23 | 78 |
| 7 | 27 | 105 |
| 8 | 31 | 136 |
The n column is the position, the middle column is what the nth-term formula gives there, and the third is everything up to and including that row. Read the third column downwards and the shape of the sum formula is visible: each row adds one more term, and the increments grow by 4 every time. The first row is the same in both tables below, because with one term the two kinds of sequence have not yet had a chance to differ.
3, 6, 12, … — the same eight rows for a geometric sequence
| n | Term | Running sum |
|---|---|---|
| 1 | 3 | 3 |
| 2 | 6 | 9 |
| 3 | 12 | 21 |
| 4 | 24 | 45 |
| 5 | 48 | 93 |
| 6 | 96 | 189 |
| 7 | 192 | 381 |
| 8 | 384 | 765 |
Same three columns, same eight positions, a different rule: here each term is the one above it doubled, so the middle column runs 3, 6, 12, 24, … and the totals pull away from the arithmetic ones quickly — 765 against 136 by the eighth row. The two tables are printed side by side on purpose: the first term and the count are identical, so every difference you see comes from the step and its type.
Formula
arithmetic — a(n) = a(1) + (n - 1) * d S(n) = n * (a(1) + a(n)) / 2 geometric — a(n) = a(1) * r^(n - 1) S(n) = a(1) * (r^n - 1) / (r - 1) except at r = 1, where S(n) = n * a(1)
- n
- Which term you are asking about, counted from 1. It is the number of terms in the sum as well, which is why one box answers both questions. The tenth term is written a(10) and the sum of the first ten is S(10).
- a(1)
- The first term, the one place the sequence starts. Everything else is derived from it, so a negative first term flips the sign of every even-indexed term in a geometric sequence and simply starts an arithmetic one further down.
- d
- The common difference, used by arithmetic sequences: the amount added at each step. It may be negative, in which case the sequence falls, or zero, in which case every term is the first one — that last case is why the printed formula collapses to something like a(n) = 6.
- r
- The common ratio, used by geometric sequences: the number each term is multiplied by. A ratio between 0 and 1 makes the terms shrink towards zero, a negative ratio makes them alternate sign, and a ratio of exactly 1 makes every term equal to the first.
- S(n)
- The sum of the first n terms — this sequence and no more. For an arithmetic sequence it is the average of the first and last term times n, which is the pairing trick Gauss is said to have used on 1 + 2 + … + 100. It is never an infinite series: raise n and the total keeps growing.
Use it whenever a quantity grows or shrinks by a fixed rule and you need a value well down the list — the balance after thirty years of the same annual deposit, the height after the twentieth bounce, the total distance covered when each step is a fixed fraction of the one before. The two boxes that decide everything are the step and its sign, so the useful habit is to work out the first three terms by hand first and check that they match the reference table below.
Worked examples
3, 7, 11, … — the tenth term and the sum of the first ten
- The step is 4, so the terms are 3, 7, 11, 15, 19, 23, 27, 31, 35, 39
- The tenth term is 3 + 9 × 4 = 39
- Pair the terms from the outside in: 3 + 39 = 42, 7 + 35 = 42, 11 + 31 = 42, and so on
- There are five such pairs, all equal to 42
- 5 × 42 = 210
The pairing is the whole of the sum formula: with n terms the average of the first and the last is (3 + 39) / 2 = 21, and 21 × 10 is the same 210. The formula printed beside the answer is the rule, not this particular sequence — a(n) = 3 + 4(n - 1) rebuilds every term from n alone, so n = 1 gives 3 back and n = 10 gives 39 without listing anything.
8, 4, 2, 1, 0.5 — a geometric sequence that shrinks
- The ratio is 0.5, so each term is half of the one before it: 8, 4, 2, 1, 0.5
- The fifth term is 8 × 0.5⁴ = 8 × 0.0625 = 0.5
- Add them: 8 + 4 + 2 + 1 + 0.5 = 15.5
The sum of a shrinking geometric sequence approaches 16 but never passes it — 8 / (1 − 0.5). This page gives the total of the five terms you asked for, 15.5, not that limit, and the difference is the whole reason the number of terms is an input.
1 + 2 + … + 1000, where the formula beats adding
- The step is 1, so the thousandth term is 1 + 999 = 1000
- Pair the first with the last: 1 + 1000 = 1001
- There are 500 such pairs, because 1000 terms make 500 pairs
- 500 × 1001 = 500500
Nothing here needs the terms to be written out, which is the point of a sum formula — the same three boxes would answer it for a million terms if n went that high. This is the calculation Gauss is said to have been set as a school punishment, and the pairing above is what he is said to have done instead.
Limitations
Two kinds of sequence only: arithmetic, where the step is added, and geometric, where it is multiplied. Anything else — squares, cubes, Fibonacci, a sequence defined by its own previous two terms — has no rule to enter here and needs its own tool. The number of terms must be a whole number from 1 to 1000; a fractional or negative count is refused rather than rounded, because 2.5 terms is not a quantity with an answer. The total is the sum of the first n terms only, never of an infinite series, so with a ratio below 1 the running total keeps creeping towards its limit without reaching it. Answers are rounded to six decimal places, and a geometric sequence can overflow the arithmetic long before n reaches its limit — 10 to the 300th is fine, 10 to the 6000th is not, and that case is reported as a failed calculation rather than as infinity. The page answers two of the four questions a sequence raises: what the nth term is and what the first n add up to. It will not do the reverse — given two terms, recover the rule; given a sum, recover n — and it prints no units, because a sequence is a list of numbers.
Frequently asked questions
- What is the difference between the nth term and the sum?
- The nth term is one number — the one sitting in position n, which for 3, 7, 11, … at n = 10 is 39. The sum is everything up to it added together, which for the same sequence is 210. They are printed as two separate lines because they answer two different questions, and because the sum is the one people usually want: a balance, a total distance, a cumulative count.
- Where does the sum formula come from?
- From pairing the terms from the outside in. In 3, 7, 11, … the first and last terms of the first ten add to 42, and so does every other such pair, so ten terms make five pairs of 42 — 210. Written generally, that is n times the average of the first and last term, n * (a(1) + a(n)) / 2. The geometric sum has a different derivation and a different shape, which is why the two are printed separately.
- Can the step be negative, or zero, or a fraction?
- All three. A negative common difference gives a sequence that falls, such as 100, 93, 86, … and a negative common ratio gives one that alternates sign, such as 1, -1, 1, -1. A ratio of 0.5 gives the shrinking sequence in the second example. The two cases that need a second look are a difference of zero and a ratio of one, where every term equals the first and the printed formula correctly shortens to something like a(n) = 6.
- Is the sum the total of the whole infinite sequence?
- No — it is the sum of the first n terms, where n is the count you entered. That distinction only shows up for a shrinking geometric sequence, where the running total approaches a limit (16 for 8, 4, 2, 1, 0.5, …) without ever reaching it. Occasionally someone wants that limit, which is the sum of an infinite geometric series, a different calculation with a different formula.
- How many terms can I ask for?
- Any whole number from 1 to 1000. The upper end is not arbitrary: a geometric sequence with a ratio of 10 reaches 10^300 at n = 300, and a few hundred more terms would push past the largest number the arithmetic can hold. That case is reported as a failed calculation rather than as infinity, so you get a message instead of an answer that is quietly wrong.
- Why does the printed formula say a(n) rather than a with a subscript?
- Because a(n) can be read in every language and every font, and the subscript character cannot — it renders as an empty box on some systems. The rest of the notation is the usual one: ^ for a power, * for multiplication, and brackets around a negative ratio, so the alternating sequence reads a(n) = (-1)^(n - 1) rather than as something that looks like -1 to the power n - 1 with the minus outside.
References
- Arithmetic progression — the rule, the nth-term formula and the sum used on this page — Wolfram MathWorld (United States)
- Geometric progression — the same three questions when the step is a multiplier rather than an addend — Wolfram MathWorld (United States)
- OEIS A000217, the triangular numbers — 1, 3, 6, 10, … the running totals of 1 + 2 + … + n, which is the third example on this page — OEIS Foundation (United States)