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
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:
| X | Input terms | Predicted terms |
|---|---|---|
| 1 | 1 | 21 |
| 2 | 1 | 34 |
| 3 | 2 | 55 |
| 4 | 3 | 89 |
| 5 | 5 | 144 |
| 6 | 8 | |
| 7 | 13 |
How to use this tool
- Enter the sequence. Type your numbers separated by commas or spaces. You need at least 3 terms; 5 or more gives better detection accuracy.
- Click Detect. Press Detect or hit Enter. The tool analyses the sequence and identifies all matching patterns.
- Read the primary pattern. The most specific matching pattern is highlighted, with a description of the rule and a formula for the general term.
- 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:
| Level | Values |
|---|---|
| Original | 3, 7, 13, 21, 31 |
| 1st differences | 4, 6, 8, 10 |
| 2nd differences | 2, 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).
Related tools
- Fibonacci GeneratorGenerate exact Fibonacci terms or ranges after identifying a Fibonacci-like pattern.
- Pascal's TriangleExplore a structured family of integer sequences formed by binomial coefficients.
- Collatz VisualizerInspect a rule-generated sequence whose long-term behavior remains unresolved.
- Number Theory ExplorerClassify and inspect individual terms from the detected sequence.