Home / Math / Number Sequence Calculator
Number Sequence Calculator: Arithmetic and Geometric
Enter the first term and the common difference or ratio to get the nth term and the sum of the first n terms. Or paste a list of numbers and let the tool detect the pattern.
Arithmetic sequences
An arithmetic sequence adds the same amount, the common difference d, to get from each term to the next. Starting from the first term a, the nth term is a + (n − 1) × d. The sequence 3, 7, 11, 15 has a = 3 and d = 4, so its tenth term is 3 + 9 × 4 = 39.
The sum of the first n terms is n ÷ 2 × (2a + (n − 1) × d), which is also the number of terms times the average of the first and last. For the example this is 10 ÷ 2 × (6 + 36) = 210. The story of pairing first and last terms to sum 1 to 100 is a classic illustration of this formula.
Geometric sequences
A geometric sequence multiplies by a fixed common ratio r each step. The nth term is a × rn−1 and the sum of the first n terms is a × (1 − rn) ÷ (1 − r) when r is not 1. If r equals 1 every term equals a, so the sum is simply a × n.
When the ratio lies strictly between −1 and 1, the terms shrink toward zero and the sum converges to a ÷ (1 − r) as the number of terms grows without limit. The calculator shows this infinite sum whenever it applies. With a ratio of 1 or larger in size, the terms do not settle and there is no finite infinite sum. Geometric growth underlies compound interest, population models and repeated halving.
Detecting a pattern from a list
In detect mode the tool checks whether the gaps between consecutive terms are all equal (arithmetic) or the quotients are all equal (geometric). It needs at least three numbers, because two numbers fit infinitely many patterns. If the test passes, the sequence is treated exactly as if you had typed the first term and the difference or ratio.
Many familiar sequences are neither. The squares 1, 4, 9, 16 have growing differences, and the Fibonacci numbers add the two previous terms. Those return a message rather than a wrong guess. A short list can also be consistent with more than one rule, so treat the detected pattern as the simplest fit, not proof of the rule behind your data.
Reading the results and avoiding slips
- Index from 1. The first term is n = 1. Using n = 0 for the first term is a common source of off-by-one errors.
- Negative and fractional values. A negative difference gives a decreasing sequence. A negative ratio makes the terms alternate in sign.
- Very large terms. Geometric terms can grow beyond what a number format can hold. When that happens the result is reported in scientific notation, or as too large.
- Sum versus term. The nth term is a single value; the sum adds every term up to n.
Worked example
A geometric sequence starts at 2 and triples each time: 2, 6, 18, 54, 162. Find the fifth term and the sum of the first five.
Inputs
| Sequence type | Geometric (multiply by a constant) |
|---|---|
| First term (a) | 2 |
| Common ratio (r) | 3 |
| Term number (n) | 5 |
Result
Sum of the first 5 terms = 242
| Type | Geometric, ratio r = 3 |
|---|---|
| First term | 2 |
| Term number 5 | 162 |
| Sum of the first 5 terms | 242 |
| Formula | a(n) = a × r^(n − 1) |
First 5 terms and running sum
| n | Term | Sum so far |
|---|---|---|
| 1 | 2 | 2 |
| 2 | 6 | 8 |
| 3 | 18 | 26 |
| 4 | 54 | 80 |
| 5 | 162 | 242 |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
How do I find the nth term of an arithmetic sequence?
Take the first term and add (n − 1) times the common difference. For 3, 7, 11 with n = 10, that is 3 + 9 × 4 = 39.
What is the difference between a sequence and a series?
A sequence is the ordered list of terms, while a series is the sum of those terms. This calculator reports both the nth term and the sum of the first n terms.
How do I find the common ratio of a geometric sequence?
Divide any term by the term before it. In 2, 6, 18, 54 each division gives 3, so the ratio is 3. All such quotients must match for the sequence to be geometric.
When does a geometric series have a finite sum to infinity?
Only when the absolute value of the ratio is less than 1. Then the sum equals the first term divided by one minus the ratio.
Why does the detector ask for three terms?
Two numbers define one difference and one ratio, so they would always look like both patterns. A third term gives the minimum evidence needed to test consistency.
Related calculators
References and sources
- Stewart, J. Calculus, chapter on sequences and series (standard formulas for arithmetic and geometric progressions).