Skip to content
Toolcroft

Sequence Detector - Identify Number Patterns & Predict Next Terms

Math Calculators

Paste a number sequence and instantly identify its pattern: arithmetic, geometric, Fibonacci, squares, cubes, triangular, primes, and more. Predicts the next 5 terms with the formula.

Enter at least 3 numbers separated by commas or spaces.

Examples:

Input sequence (7 terms)

1, 1, 2, 3, 5, 8, 13

Fibonacci

Each term = sum of previous two: a(n) = a(n−1) + a(n−2)

a(n) = a(n−1) + a(n−2), a(1)=1, a(2)=1

Next 5 terms:

21345589144
Loading chart…
Sequence plot
XInput termsPredicted terms
1121
2134
3255
4389
55144
68
713

How to use this tool

  1. Enter the sequence. Type your numbers separated by commas or spaces. You need at least 3 terms; 5 or more gives better detection accuracy.
  2. Click Detect. Press Detect or hit Enter. The tool analyses the sequence and identifies all matching patterns.
  3. Read the primary pattern. The most specific matching pattern is highlighted, with a description of the rule and a formula for the general term.
  4. See the next terms. The next 5 terms predicted by the detected pattern are shown. If multiple patterns match, all are listed below the primary result.

How sequence detection works

The tool analyses finite differences and ratios to identify the pattern type. It checks for constant first differences (arithmetic), constant ratios (geometric), constant second differences (quadratic), and Fibonacci recurrences, as well as matching against known integer sequences (squares, cubes, triangular, primes, powers of 2).

Detectable patterns

  • Arithmetic: constant difference (e.g. 3, 7, 11, 15)
  • Geometric: constant ratio (e.g. 2, 6, 18, 54)
  • Fibonacci-like: a(n) = a(n−1) + a(n−2) (e.g. 1, 1, 2, 3, 5, 8)
  • Perfect squares: 1, 4, 9, 16, 25, …
  • Perfect cubes: 1, 8, 27, 64, 125, …
  • Triangular numbers: 1, 3, 6, 10, 15, …
  • Powers of 2: 1, 2, 4, 8, 16, …
  • Powers of 3: 1, 3, 9, 27, 81, …
  • Consecutive primes: 2, 3, 5, 7, 11, …
  • Quadratic: constant second differences (e.g. 0, 2, 6, 12, 20)
  • Cubic: constant third differences

Tips for best results

  • Provide at least 5 terms for reliable detection of quadratic and cubic patterns.
  • For Fibonacci-like sequences, the first two terms uniquely determine the rest.
  • If a sequence matches multiple patterns, the most specific is shown first.
  • Floating-point sequences are compared with a small tolerance to handle rounding.

Worked detection example

For the sequence 3, 7, 13, 21, 31, the detector computes finite differences:

LevelValues
Original3, 7, 13, 21, 31
1st differences4, 6, 8, 10
2nd differences2, 2, 2

The second differences are constant (all 2), which confirms a quadratic sequence. The pattern is a(n) = n² + n + 1 (0-indexed). This method generalizes: constant first differences -> arithmetic; constant second differences -> quadratic; constant third differences -> cubic.

Limitations

Sequence detection is probabilistic, not proven - a match means the pattern fits the provided terms, but the true rule could be more complex. Specific limitations to be aware of:

  • Sequences with fewer than 4 terms are unreliable for quadratic/cubic detection - not enough terms to distinguish patterns.
  • Floating-point sequences (e.g., from measured data) may introduce small rounding errors that confuse the difference comparisons.
  • The tool checks a finite set of known patterns; unusual or novel sequences may return "no pattern detected" even when a rule exists.

OEIS: the encyclopedia of integer sequences

The On-Line Encyclopedia of Integer Sequences (oeis.org) contains over 370,000 catalogued sequences with formulas, references, and code. If this tool doesn't recognize your sequence, searching OEIS is the next step - paste your terms into the search box separated by commas.

Frequently asked questions

What is an arithmetic sequence?

An arithmetic sequence has a constant difference between consecutive terms. For example: 3, 7, 11, 15, … (difference = 4). The general term is a(n) = a + (n−1)·d, where a is the first term and d is the common difference.

What is a geometric sequence?

A geometric sequence has a constant ratio between consecutive terms. For example: 2, 6, 18, 54, … (ratio = 3). The general term is a(n) = a · rⁿ⁻¹, where a is the first term and r is the common ratio.

How are Fibonacci sequences detected?

A Fibonacci-like sequence satisfies a(n) = a(n−1) + a(n−2) - each term is the sum of the two preceding terms. The classic Fibonacci sequence starts 1, 1, 2, 3, 5, 8, … Other starting values give related sequences (Lucas: 2, 1, 3, 4, 7, …).

Why do some sequences match multiple patterns?

Some sequences are simultaneously members of multiple pattern families. For example, 1, 4, 9, 16 is both a quadratic sequence (second differences = 2) and the perfect squares. The tool reports the most specific match first.

What patterns can this tool detect?

Arithmetic, geometric, Fibonacci-like, perfect squares, perfect cubes, triangular numbers, powers of 2, powers of 3, consecutive primes, quadratic (constant second differences), and cubic (constant third differences).

Browse all math calculators