Skip to main content
Mathovia

Math / Algebra

Sequence Calculator

Enter the terms you have and the calculator works out the rule: arithmetic, geometric, quadratic or cubic, Fibonacci-type, factorial or prime. It gives the general term, the next numbers in the sequence and any term you ask for, and shows the difference table it used.

Enter at least three terms; four or more lets the solver confirm the pattern instead of just fitting it. Fractions and negatives are fine.

Pattern found

Quadratic sequence

Next terms 2, 5, 10, 17, 26, 37, 50, 65, 82, 101, …

Formula aₙ = n² + 1

Rule aₙ = aₙ₋₁ + (2n − 1)

Table of differences: the highlighted row is constant

terms
25101726
Δ
3579
Δ2
222

Given terms (filled) and predicted terms (open)

05010012345678910
  1. Subtract each term from the next. The differences are not all equal, so it isn’t arithmeticdifferences: 3, 5, 7, 9
  2. Divide each term by the one before. The ratios aren’t constant either, so it isn’t geometricratios: 5/2, 2, 17/10, 26/17
  3. Keep taking differences. Row 2 is constantsecond differences: 2, 2, 2
  4. A constant row 2 means the formula is a degree-2 polynomial in n. Fit it to the first 3 termsaₙ = n² + 1
Written by
MPhil in Mathematics, Founder of Mathovia
Published

Mathematics verification: Mathematical formulas, calculations, worked examples and solutions are reviewed for accuracy before publication. How we check our work

“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.

A quadratic sequence has the form a sub n equals a n squared plus b n plus c, where 2a equals the constant second difference
Constant second differences mean a quadratic formula

How to use the sequence calculator

  1. Type the terms you know, separated by commas: 2, 5, 10, 17, 26. Negatives, decimals and fractions all work.
  2. Choose how many next terms you want, up to 20.
  3. Optionally, enter a term number to jump straight to, say, the 50th term.
  4. 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. , then 5, 7, 9. They aren’t equal, so the sequence isn’t arithmetic.

Step 2 — ratios. , . Not equal either, so it isn’t geometric.

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 . Fitting the first terms gives and , so .

Step 4 — continue. The next difference is 11, so the next term is , and the formula agrees: . The 50th term is .

The four questions that identify most sequences

A flowchart of four questions: are the differences equal (arithmetic, like 3, 7, 11, 15); are the ratios equal (geometric, like 2, 6, 18, 54); are the second differences equal (quadratic, like 2, 5, 10, 17, 26); is each term the sum of the two before (Fibonacci-type, like 1, 1, 2, 3, 5, 8); and if not, try third differences, growing differences, factorials or primes
Ask the questions in order and stop at the first yes

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:

RowValues
terms1, 8, 27, 64, 125
1st differences7, 19, 37, 61
2nd differences12, 18, 24
3rd differences6, 6

A constant row means the formula is a polynomial of degree . Here the third differences are constant, so it’s cubic, and in fact these are the cubes, . The constant value tells you the leading coefficient: for degree it’s times that coefficient, so .

Patterns the calculator recognises

PatternExampleRule it finds
arithmetic3, 7, 11, 15
geometric2, 6, 18, 54
quadratic1, 3, 6, 10, 15 (triangular numbers)
cubic1, 8, 27, 64
differences grow geometrically1, 3, 7, 15, 31
Fibonacci-type1, 1, 2, 3, 5, 8
other two-term rules1, 2, 5, 12, 29
factorials1, 2, 6, 24, 120
primes2, 3, 5, 7, 11the 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 unknown numbers needs terms just to pin it down, and one more to check it. A quadratic has three unknowns, , and , so three terms always fit one, whatever the numbers are. Give the calculator 1, 4, 9 and it will say the formula is , but it also warns that the pattern is only fitted, not confirmed. Add 16 and the fourth term checks it.

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 (next 14). Both are correct continuations. More terms remove the doubt.

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 straight away. When nothing standard fits, look at the digits themselves, or at the position of each term, before assuming the question has a trick. Often it does.

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.

Frequently Asked Questions

How do you find the pattern in a sequence of numbers?+

Work through the common patterns in order. Subtract neighbouring terms: equal differences mean arithmetic. Divide them: equal ratios mean geometric. Take differences of the differences: equal second differences mean quadratic. Then check whether each term is the sum of the two before, as in the Fibonacci sequence.

What is the next number in 2, 5, 10, 17, 26?+

37. The differences are 3, 5, 7, 9, so the next difference is 11. The second differences are all 2, which makes the sequence quadratic, and the formula is aₙ = n² + 1.

How do you find the general term (nth term) of a sequence?+

Identify the pattern first, then use its formula: aₙ = a₁ + (n − 1)d for arithmetic, aₙ = a₁ · rⁿ⁻¹ for geometric, and for a quadratic, aₙ = an² + bn + c with a equal to half the second difference. The calculator does this and shows the formula it found.

How many terms do I need to identify a sequence?+

At least one more than the pattern needs. Three terms fix a quadratic exactly, so with only three the calculator can fit one but not check it. Four or five terms let it confirm the pattern, and it tells you which case you're in.

Can any list of numbers be continued?+

Mathematically, any finite list can be continued in infinitely many ways. The calculator picks the simplest standard rule that fits every term you gave. If none fits, it says so rather than inventing a pattern.

What is the formula for the Fibonacci sequence?+

The usual rule is recursive: aₙ = aₙ₋₁ + aₙ₋₂, starting from 1, 1. There is also an exact explicit formula, Binet's formula, using the golden ratio, but the recursive rule is how terms are normally worked out. The 30th Fibonacci number is 832,040.

Learn and practice this topic

Related calculators