“What’s the next number?” is one of the oldest puzzles in maths, and it turns up everywhere from homework to job aptitude tests. Most of the sequences you’ll meet follow one of a handful of rules, and there’s a systematic way to find which. This sequence calculator runs through that process for you. It finds the pattern, gives the formula for the nth term, continues the sequence, and shows the table of differences it used to get there.
How to use the sequence calculator
- Type the terms you know, separated by commas:
2, 5, 10, 17, 26. Negatives, decimals and fractions all work. - Choose how many next terms you want, up to 20.
- Optionally, enter a term number to jump straight to, say, the 50th term.
- Read the result. The calculator names the pattern, gives the formula and the rule, lists the next terms and shows the difference table and a plot, with your terms filled in and the predicted ones hollow.
Worked example: 2, 5, 10, 17, 26
This is the calculator’s opening example, and a classic test question.
Step 1 — first differences.
Step 2 — ratios.
Step 3 — second differences. The differences of 3, 5, 7, 9 are 2, 2, 2. They’re constant, which means the formula is quadratic:
So
Step 4 — continue. The next difference is 11, so the next term is
The four questions that identify most sequences
The order matters because each test is stricter than the one before it. An arithmetic sequence passes the first test, a geometric sequence the second, and so on. The calculator follows the same order and reports the first pattern that fits all the terms, which is the simplest explanation of your data.
The table of differences
The difference table is the most useful single tool for number sequences. Write the terms in a row, put the differences underneath, then the differences of those, and keep going until a row is constant:
| Row | Values |
|---|---|
| terms | 1, 8, 27, 64, 125 |
| 1st differences | 7, 19, 37, 61 |
| 2nd differences | 12, 18, 24 |
| 3rd differences | 6, 6 |
A constant row
Patterns the calculator recognises
| Pattern | Example | Rule it finds |
|---|---|---|
| arithmetic | 3, 7, 11, 15 | |
| geometric | 2, 6, 18, 54 | |
| quadratic | 1, 3, 6, 10, 15 | |
| cubic | 1, 8, 27, 64 | |
| differences grow geometrically | 1, 3, 7, 15, 31 | |
| Fibonacci-type | 1, 1, 2, 3, 5, 8 | |
| other two-term rules | 1, 2, 5, 12, 29 | |
| factorials | 1, 2, 6, 24, 120 | |
| primes | 2, 3, 5, 7, 11 | the next prime |
The “differences grow geometrically” row catches a pattern people often miss. In 1, 3, 7, 15, 31, the differences 2, 4, 8, 16 double each time, so each term is one less than a power of 2. The Fibonacci-type rule doesn’t have to start at 1, 1 either: 1, 3, 4, 7, 11, 18 (the Lucas numbers) follows the same rule from a different start.
How many terms are enough?
A pattern with
This is why “what comes next?” puzzles with only three numbers are a bit unfair. 2, 4, 8 could be doubling (next 16) or a quadratic
Sequences in puzzles and aptitude tests
Number-sequence questions in aptitude tests mostly use the same patterns, sometimes disguised. A sequence that alternates between two rules, like 2, 4, 3, 6, 5, 10, is really two sequences interleaved: the odd positions 2, 3, 5 and the even positions 4, 6, 10, where each even term is double the term before it. Split it and solve each half. Squares and cubes with a constant added, like 3, 6, 11, 18, 27, are quadratics in disguise; the calculator finds
Common mistakes when finding patterns
- Stopping at the first differences. Unequal differences don’t mean there’s no pattern; look one row further down.
- Mixing up
and the term. The formula gives the term from its position: in , the 5th term is , not . - Forgetting negative ratios. 1, −2, 4, −8 is geometric with
, even though the terms jump back and forth. - Reading too much into three terms. Always check a rule against every term you have.
To tell the two most common patterns apart, see arithmetic vs geometric sequences. Once you know the type, the arithmetic sequence calculator and geometric sequence calculator give sums and formulas for that type in more detail.