Math calculator

Nth Term Calculator

Give it the terms; it finds the rule, and says how much they establish.

Give it the terms, get the rule

With how much the terms actually establish.

Arithmetic

aₙ = 4 + (n − 1) × 3

Every consecutive difference is 3, so the terms step by a fixed amount.

Pattern

Arithmetic

from 5 terms

Next three terms

19, 22, 25

if the rule holds

How solid is this

reasonable

Four or more equal differences is strong evidence.

Constant ratio?

no

term divided by the one before

The difference table

The entered terms and each successive level of differences between them
LevelValues
Terms4, 7, 10, 13, 16
1st differences3, 3, 3, 3 ← constant
2nd differences0, 0, 0 ← constant
3th differences0, 0 ← constant
4th differences0

Read down until a row is constant. Constant first differences mean a linear rule; constant second differences mean a quadratic one, with the n² coefficient equal to half that constant. If nothing settles within four levels, the rule is not polynomial of low degree.

  • Any finite list of terms fits infinitely many rules. What is reported is the simplest fit among the standard families, which is a claim about parsimony rather than about the sequence.
  • The difference table below is the working: read down a column until a row is constant, and the level at which that happens is the degree of the rule.

Differences and ratios are exact fractions, so 0.1, 0.2, 0.3 is recognised as arithmetic instead of failing on floating-point noise.

What this tool shows

4, 7, 10, 13, 16 gives an = 4 + (n − 1)×3. 1, 4, 9, 16, 25 gives a quadratic, found from the second differences. And 1, 4, 9, 61, 52 gives no rule — which is a better answer than an invented one.

  • The nth-term rule for a list of terms
  • Arithmetic, geometric, quadratic and Fibonacci-like patterns
  • The full difference table as working
  • The next three terms, if the rule holds
  • How much the terms you gave actually establish
  • An honest "no rule found" when there is none
Four families tested The difference table shown The next three terms Confidence stated

Exact fractions, so decimal terms are recognised too.

Updated 7 September 2026 · Works in any browser, no installation

Take the differences between consecutive terms. If they are constant, the rule is an = a1+ (n − 1)d. If not, take the differences of those: if THOSE are constant, the rule is quadratic, and the n² coefficient is half that constant. If the ratios are constant instead, it is geometric.

At a glance

Formula shown
Constant first differences mean a\u2099 = a\u2081 + (n \u2212 1)d. Constant second differences mean a quadratic, with the n\u00b2 coefficient equal to half the second difference. A constant ratio means geometric. Each term being the sum of the two before it means a Fibonacci-like rule, which has no simpler closed form than the rule itself.
Scenario support
A homework question that gives terms and asks for the rule; checking whether a data series is linear or quadratic; continuing a pattern you have observed.
Educational estimate
Planning support from the values you enter — not professional advice.

How the difference table works

Write the terms in a row. Underneath, write the gaps between them. Underneath that, the gaps between the gaps. Keep going until a row is constant.

For 1, 4, 9, 16, 25 the first differences are 3, 5, 7, 9 — not constant. The second differences are 2, 2, 2 — constant. Two levels down means the rule is a degree-2 polynomial, a quadratic.

The level at which the table goes constant is the degree of the rule. Linear rules settle after one level, quadratics after two, cubics after three. A table that never settles is not a polynomial of low degree at all.

This is the method of finite differences, and it is the discrete cousin of differentiation: differencing a degree-n polynomial gives a degree-(n−1) one, exactly as differentiating does.

The four families

Arithmetic. Constant first difference. 4, 7, 10, 13 steps by 3 every time, so an= 4 + (n − 1)×3.

Geometric. Constant ratio. 2, 6, 18, 54 multiplies by 3 every time, so an = 2 × 3(n−1). Differences will never settle for these, which is why the ratios are checked separately.

Quadratic. Constant second difference. 3, 8, 15, 24, 35 has second differences of 2, so the rule is n² + 2n.

Fibonacci-like. Each term is the sum of the two before it. 2, 3, 5, 8, 13. There is no simple closed form here — the recursive rule IS the answer, and any closed form needs the golden ratio.

Why three terms prove nothing

Give me 2, 4, 6 and I will say an = 2n. I could equally say an= n³ − 6n² + 13n − 6, which also gives 2, 4, 6 and then continues 14 rather than 8.

Both are correct. Any finite list of terms is consistent with infinitely many rules, and for any next term you like there is a polynomial that produces it. Pattern-finding is not deduction; it is a bet on simplicity.

Which is a defensible bet, and worth making explicit rather than hiding. This page reports the simplest fit among the standard families and tells you how thin the evidence is. With five or more terms confirming a rule, the simplest fit is usually the intended one. With three, it is a guess with good manners.

So the confidence line is part of the answer, not a disclaimer attached to it.

Deriving a quadratic by hand

Worth knowing, because it is quick and the page shows the same table you would build.

Take 3, 8, 15, 24, 35. First differences: 5, 7, 9, 11. Second differences: 2, 2, 2. Constant, so the rule is an² + bn + c.

a is half the second difference, so a = 1. b comes from the first difference: the first one is 5, and the first difference of an² + bn + c at that point is 3a + b, so b = 5 − 3 = 2. c from the first term: 3 = 1 + 2 + c, so c = 0.

The rule is n² + 2n. Check it: n = 4 gives 16 + 8 = 24, which is the fourth term. Substituting back is the step worth not skipping.

When no rule is found

The page tests constant first differences, constant second differences, constant ratios and the Fibonacci rule. If none fits, it says so and stops.

That is deliberate. A formula fitted through any five points always exists — a degree-4 polynomial goes through any five — and reporting it would technically be correct and practically worthless. It would tell you nothing about the sequence and would predict the sixth term badly.

If you have a sequence with a real rule that this page does not find, the On-Line Encyclopedia of Integer Sequences is the right next stop: it holds hundreds of thousands of catalogued sequences and will identify most of them from a handful of terms.

Sequences with no simple formula

Plenty of important sequences have no closed form at all, and it is worth knowing that the absence is normal rather than a failure of technique.

The primes. 2, 3, 5, 7, 11, 13. No formula generates the nth prime. There are approximations — the nth prime is roughly n ln n — but nothing exact.

Collatz stopping times. 27 takes 111 steps while its neighbours take 10 and 18. No formula predicts it, and there may not be one.

Recursive definitions generally. The Fibonacci numbers have a closed form only because their recurrence is linear. Most recurrences do not, and the rule itself is the best description available.

Sources and methodology

The method of finite differences is standard, and the limits of pattern-fitting are worth citing too.

Method. The differences are computed as exact fractions, so 0.1, 0.2, 0.3 is recognised as arithmetic instead of failing on floating-point noise, and 1/2, 1/4, 1/8 is recognised as geometric. Four families are tested in order of simplicity and the first exact fit is reported — with the difference table shown as the working rather than as decoration. When none of them fits, the page says which tests were tried and returns no rule, because an invented formula would be worse than an admitted failure. That engine is verified on every change against 76 hand-written assertions, including that each of the six standard families is identified and continued with the correct next three terms, and that no rule is invented for lists that have none. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Arithmetic SequenceNth term and sum with both formulas substituted, carried as exact fractions — a step of 0.1 gives exactly 4 at term 40 rather than 3.9999999999999996.
Geometric SequenceNth term, partial sum, and whether the infinite series converges at all — with exact ratios, so 1/3 stays 1/3 instead of becoming 0.3333333333.
FibonacciEvery digit of F(n), not a rounded double — a JavaScript number stops being exact at F(79), and F(80) is where most web calculators quietly go wrong.
Pascal’s TriangleThe triangle drawn to any row up to 40, exact on big integers, with the row sum as a power of two and each diagonal's meaning named.
Quadratic FormulaSolve any quadratic with exact roots — surds stay surds and a negative discriminant gives the complex pair — plus the vertex, the factored form and every step of the working.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.

More in Math, or browse all calculators.

Read the guide

Once you know the family, the Arithmetic and Geometric Sequence Calculators take it further — terms, partial sums, and for a geometric one whether the infinite series converges.

Educational use disclaimer

This is an educational tool. Any finite list of terms is consistent with infinitely many rules; what is reported is the simplest fit among the standard families, which is a claim about parsimony rather than about the sequence.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 7 September 2026

  1. Published the nth-term page reporting its own confidence, because any finite list of terms fits infinitely many rules and three terms establish very little.
  2. The difference table is shown as the working rather than as decoration: the level at which a row goes constant is the degree of the rule.
  3. A list with no standard pattern returns 'no rule found' with the tests that were tried, since a degree-4 polynomial through any five points would be technically correct and practically worthless.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.