How to Find the Pattern in a Number Sequence

How to find the pattern in a number sequence - finite difference table narrowing to a constant row, with a Fibonacci spiral illustrating recursive growth
Marko Šinko
9 min read
Number SequencesPattern RecognitionMath LearningProblem Solving

Subtract. That's the whole trick. Given 2, 5, 10, 17, 26, … most people stare at the numbers hoping a rule jumps out. Don't. Write the gaps underneath instead: 3, 5, 7, 9. Now subtract again: 2, 2, 2. The moment a row of differences goes constant, you've found the sequence — everything after that is bookkeeping.

That two-row calculation tells you the sequence is quadratic, that its formula starts with n², and that the next term is 37. It took about eight seconds. Below is the full procedure: which test to run first, what each result means, how to turn differences into an nth-term formula, and — the part almost every tutorial skips — how to tell when a sequence genuinely has no unique answer.

Start With Differences, Not Inspiration

The finite-difference method is the closest thing sequences have to a universal opening move. Write the terms in a row. Underneath, write each term minus the one before it. Repeat on that new row. Keep going until a row turns constant — or until you run out of terms.

Where the constant row appears tells you the degree of the polynomial that generates the sequence:

Constant row appears atSequence typenth term looks likeExample
1st differencesArithmetic (linear)an + b4, 7, 10, 13 → 3n + 1
2nd differencesQuadratican² + bn + c2, 5, 10, 17 → n² + 1
3rd differencesCubican³ + bn² + cn + d1, 8, 27, 64 → n³
Never (differences grow)Exponential, recursive, or exoticarⁿ, F(n−1)+F(n−2), n!3, 6, 12, 24 → 3·2ⁿ⁻¹

A degree-k polynomial needs k + 1 differences rows, which means it needs at least k + 2 terms before you can pin it down. Four terms is the practical minimum for a quadratic; five is comfortable. With three terms you are guessing, no matter how confident the guess feels. Our pattern calculator runs the whole difference table for you and reports which row went constant.

Worked example: 3, 12, 27, 48, 75

1st differences: 9, 15, 21, 27

2nd differences: 6, 6, 6 — constant, so it's quadratic.

Leading coefficient = 6 ÷ 2 = 3, so the formula starts 3n². Check n = 1: 3(1)² = 3, and the first term is 3. Check n = 2: 3(4) = 12. ✓ The formula is simply 3n², and the sixth term is 3(36) = 108.

When Differences Explode, Divide Instead

If the difference rows keep growing instead of settling, stop subtracting and start dividing. Take each term over its predecessor. A constant quotient means the sequence is geometric, and you're done in one row rather than three.

Take 5, 15, 45, 135. Differences are 10, 30, 90 — growing, and their differences are 20, 60, still growing. Ratios, though: 15/5 = 3, 45/15 = 3, 135/45 = 3. Constant. The rule is an = 5 · 3n−1, and term 7 is 5 · 729 = 3,645.

One warning about ratios: they lie more readily than differences do. The sequence 1, 2, 4, 8 has ratio 2 throughout, but so does the count of regions you get by joining n points on a circle — until the sixth term, which is 31, not 32. Two consistent ratios prove nothing. Three are suggestive. If the numbers come from a real problem rather than a puzzle book, verify the rule against the underlying situation, not just the digits. You can test both readings quickly with the geometric sequence calculator and compare against the arithmetic sequence calculator.

A useful hybrid case: differences that are themselves geometric. In 2, 5, 11, 23, 47 the gaps are 3, 6, 12, 24 — doubling. That makes the rule an = 2an−1 + 1, which is recursive rather than polynomial, and it's exactly the kind of relation the recurrence relation calculator converts into a closed form (here, 3 · 2n−1 − 1).

The Order to Try Things In

Most sequences fall to one of six tests, and running them in this order minimises wasted effort. Each row assumes the previous test already failed.

StepTestSignals itTypical rule
1Finite differencesA row goes constantPolynomial in n
2RatiosConstant quotientGeometric arⁿ⁻¹
3Sum of two previous termsa + b = next, repeatedlyFibonacci-type recurrence
4Compare to n², n³, 2ⁿ, n!Terms sit near a famous familyOffset of a known sequence
5Split odd and even positionsTerms zig-zag up and downTwo interleaved sequences
6Look at the digits, not the valuesValues jump erraticallyDigit sums, digit powers, spelling

Step 5 catches more puzzles than people expect. Given 1, 10, 4, 20, 9, 30, nothing sensible comes out of the differences — but the odd positions are 1, 4, 9 (squares) and the even positions are 10, 20, 30 (multiples of ten). Two sequences shuffled together. Splitting them takes five seconds and turns an impossible problem into two trivial ones.

Step 6 covers the sequences that aren't about magnitude at all. 1, 153, 370, 371, 407 looks random until you cube each digit and add: 1³ + 5³ + 3³ = 153. These are Armstrong numbers, and you can enumerate them with the Armstrong number calculator. Similar digit-driven families include 6, 28, 496, 8128 — the perfect numbers, where the proper divisors sum back to the number itself.

Turning Differences Into an Actual Formula

Recognising "this is quadratic" is only half the job. Here's the mechanical way to get from a difference table to an explicit nth-term formula, using 4, 13, 28, 49, 76 as the example.

First differences: 9, 15, 21, 27. Second differences: 6, 6, 6. Constant at row two, so the answer has the form an² + bn + c.

  1. Leading coefficient. For a quadratic, a = (second difference) ÷ 2 = 6 ÷ 2 = 3. In general, for degree k the leading coefficient is (kth difference) ÷ k!.
  2. Subtract the leading part. Compute 3n² for n = 1…5: 3, 12, 27, 48, 75. Subtract from the original terms: 1, 1, 1, 1, 1.
  3. Read off the remainder. The leftovers are constant at 1, so b = 0 and c = 1.
  4. Assemble and verify. an = 3n² + 1. Test the last given term: 3(25) + 1 = 76. ✓

Step 2 is the part worth internalising. Peeling off the highest-degree piece reduces a quadratic to a linear problem, and a cubic to a quadratic one — the same recursion that makes the whole method work. If the leftovers in step 3 aren't constant, run the procedure again on them; you had the degree wrong.

For recursive sequences this approach fails, because the terms depend on each other rather than on n. That's where generating functions earn their keep: encode the sequence as coefficients of a power series, solve algebraically, then read the closed form back out. The generating function calculator handles that conversion, and the Fibonacci calculator shows the classic result — Binet's formula, which computes F(n) directly from φⁿ without iterating.

Sequences Worth Recognising on Sight

Roughly four out of five sequence puzzles are built from a short list of families, usually shifted, scaled, or offset by a constant. Memorising the first few terms of each is the cheapest speed-up available.

FamilyFirst termsRuleGiveaway
Squares1, 4, 9, 16, 25, 36Gaps are odd numbers
Cubes1, 8, 27, 64, 1253rd differences all 6
Triangular1, 3, 6, 10, 15, 21n(n+1)/2Gaps are 2, 3, 4, 5…
Powers of 21, 2, 4, 8, 16, 322ⁿ⁻¹Each term doubles
Fibonacci1, 1, 2, 3, 5, 8, 13F(n−1) + F(n−2)Ratios drift toward 1.618
Primes2, 3, 5, 7, 11, 13, 17No closed formOnly even term is 2
Factorials1, 2, 6, 24, 120, 720n!Ratios are 2, 3, 4, 5…
Catalan1, 1, 2, 5, 14, 42, 132C(2n,n)/(n+1)Ratios approach 4

The "giveaway" column matters more than the formulas. You rarely recognise 1, 3, 6, 10 as n(n+1)/2 directly, but you do notice that the gaps count up 2, 3, 4 — and that fingerprint is unmistakable. Similarly, factorials are easiest to spot by their ratios: any sequence whose quotients march 2, 3, 4, 5 is factorial-shaped.

Offsets are the usual disguise. 2, 5, 10, 17 is just squares plus one; 0, 3, 8, 15 is squares minus one; 3, 12, 27, 48 is three times the squares. Before concluding a sequence is exotic, subtract the nearest famous family and see whether the remainder is constant. If you need to check a term quickly, the sequence calculator evaluates nth terms for all of the standard families, and the prime calculator settles primality arguments in one click.

Why "1, 2, 4, 8, …" Has More Than One Right Answer

Here's the uncomfortable fact most sequence tutorials leave out: any finite list of numbers has infinitely many valid continuations. Give me four terms and a target fifth term, and I can construct a polynomial that produces exactly your four terms and then my chosen fifth. That isn't a loophole — it's Lagrange interpolation, and it always works.

The classic demonstration is 1, 2, 4, 8, 16. Everyone answers 32. But count the regions formed when n points on a circle are joined by every possible chord: 1, 2, 4, 8, 16, 31. The sequence is genuinely 1, 2, 4, 8, 16, 31, 57, 99 — a quartic polynomial that impersonates powers of two for exactly five terms before breaking character.

This has two practical consequences. First, a "pattern" question is really asking for the simplest rule that fits, not the only one — simplest usually meaning lowest polynomial degree or fewest operations. Second, more terms narrow the field fast. Five terms of a quadratic leave essentially no room for argument; three terms of anything leave plenty.

When a sequence comes from a real process — a physics measurement, a loan schedule, a counting argument — derive the rule from the process and use the numbers only to check it. When it comes from a puzzle, take the simplest fit and move on. And when a sequence resists every test above, it may not have a formula at all: primes don't, and neither do the digits of π. Some sequences are defined by a procedure rather than an expression, which is a legitimate answer rather than a failure. The On-Line Encyclopedia of Integer Sequences catalogues over 380,000 of them and is the right place to look when your own tests come up empty.

Five Mistakes That Cost Marks

These come up constantly in exam scripts, and every one of them is avoidable in under a minute.

  • Off-by-one in the index. A geometric sequence starting at 5 with ratio 3 is 5 · 3n−1, not 5 · 3n. Always substitute n = 1 and confirm you get the first term back. This single check catches most formula errors.
  • Stopping at one constant difference. Two identical second differences prove nothing; 6, 6 can be followed by 7. Get at least three before declaring the row constant, which means at least five original terms for a quadratic.
  • Confusing the sequence with its sum. The nth term of 2, 4, 6, 8 is 2n; the sum of the first n terms is n(n+1). Questions asking for "the total after 20 steps" want the second, and the summation calculator or the series calculator is the right tool there.
  • Ignoring sign alternation. In 3, −6, 12, −24, the magnitudes are geometric with ratio 2 and the signs flip. Fold the alternation into the formula as (−1)n+1 · 3 · 2n−1 rather than describing it in words.
  • Forcing a formula onto a parity or digit pattern. 2, 4, 6, 8, 10 and 1, 3, 5, 7, 9 are simply the even and odd numbers — 2n and 2n − 1. If you find yourself building a cubic for something that basic, step back and check parity first with the even odd calculator.

One habit prevents four of the five: after writing any formula, test it against every given term, not just the first. It costs fifteen seconds and catches errors that would otherwise propagate through an entire question.

Three Sequences to Test Yourself On

Run the procedure on these before checking the answers. Differences first, then ratios, then the recursive and interleaving tests.

A · 5, 11, 21, 35, 53

Differences 6, 10, 14, 18; second differences 4, 4, 4. Quadratic with a = 2. Subtract 2n²: 3, 3, 3, 3, 3. So an = 2n² + 3, next term 77.

B · 2, 3, 5, 8, 13, 21

Differences 1, 2, 3, 5, 8 — the sequence reappearing inside itself. Each term is the sum of the two before it, so it's Fibonacci shifted. Next term 34.

C · 1, 8, 2, 16, 3, 32

Differences are chaos. Split by position: odds give 1, 2, 3 and evens give 8, 16, 32. Two interleaved sequences. Next term 4, then 64.

Sequence C is the one that catches people, and it's the reason step 5 sits in the decision table at all. Anything that oscillates instead of trending is worth splitting before you spend three minutes on a difference table that was never going to converge.

Once you've worked through these by hand, feed harder examples into the pattern calculator and compare its reasoning to yours — it shows the difference table and the rule it settled on, so you can see exactly where your own analysis diverged. Understanding the method matters more than the answer; a calculator gives you the next term, but only the method tells you whether that term deserves any confidence.

Share this article

Help others discover this content

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.