Math Calculators
Sequence Detector - Identify Number Patterns & Predict Next Terms
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 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.