Sequence Pattern Finder
Last updated: 27 June 2026
Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI
- The On-Line Encyclopedia of Integer Sequences (OEIS) began in 1964 as Neil Sloane's personal card catalog โ you can search it to identify almost any integer sequence.
- Finite differences reveal polynomial patterns: if a sequence's second differences are constant, it comes from a quadratic formula.
- The 'look-and-say' sequence (1, 11, 21, 1211, ...) was popularized by John Conway, who proved its terms grow by a fixed ratio of about 1.303.
Sequence Pattern Finder
A sequence pattern finder analyses a series of numbers and identifies the underlying rule or pattern, whether arithmetic, geometric, Fibonacci-type, polynomial, or another type of progression. It is used by maths students working on pattern recognition problems, puzzle enthusiasts, and educators creating number sequence exercises.
How to Use the Sequence Pattern Finder
- Enter your sequence of numbers separated by commas (for example: 2, 5, 8, 11, 14).
- Click Analyse to detect the pattern and identify the sequence type.
- Review the identified rule, formula, and sequence type.
- See the next several terms predicted by the pattern.
- Use the general term formula (the nth term) to calculate any term in the sequence directly.
The Formula
For an arithmetic sequence (constant difference d): nth term: a(n) = a(1) + (n - 1) x d
For a geometric sequence (constant ratio r): nth term: a(n) = a(1) x r^(n-1)
For a quadratic sequence (second differences are constant): nth term: a(n) = An^2 + Bn + C
For Fibonacci-type sequences: a(n) = a(n-1) + a(n-2)
The tool calculates first differences (subtracting consecutive terms), second differences, and ratios to identify which pattern applies.
Real-World Example
Sequence: 3, 7, 13, 21, 31
First differences: 4, 6, 8, 10 Second differences: 2, 2, 2
Constant second differences confirm this is a quadratic sequence.
Using the standard method: second difference = 2, so A = 2/2 = 1. So a(n) = n^2 + Bn + C.
For n=1: 1 + B + C = 3, so B + C = 2. For n=2: 4 + 2B + C = 7, so 2B + C = 3.
Subtracting: B = 1, C = 1.
General term: a(n) = n^2 + n + 1
Verify: a(1) = 1+1+1 = 3. a(3) = 9+3+1 = 13. Correct.
Next term: a(6) = 36+6+1 = 43.
Sequences in Mathematics and Nature
Sequences appear throughout mathematics and the natural world. Arithmetic sequences describe situations with a constant rate of change, such as monthly savings contributions, evenly spaced fence posts, or regularly scheduled events. Geometric sequences model exponential growth and decay, including compound interest, population growth, radioactive decay, and the spread of disease. Fibonacci sequences appear in the arrangement of leaves, seeds, and petals in plants, in the spirals of shells, and in the proportions seen in art and architecture. Polynomial sequences arise in combinatorics: the triangular numbers (1, 3, 6, 10, 15...) count the number of handshakes between n people, and the square numbers appear in grid problems. Prime numbers form a sequence with no closed-form general term, which is part of what makes them so mathematically fascinating and practically useful in cryptography.
Frequently Asked Questions
How does the tool identify the type of sequence? The tool computes successive differences between terms. If the first differences are constant, it is arithmetic. If the first differences form a geometric sequence (constant ratio), the original sequence is geometric. If the second differences are constant, it is quadratic. If the third differences are constant, it is cubic. If neither of these patterns applies, the tool checks for Fibonacci-type rules, powers, and other common patterns.
What if my sequence has no obvious pattern? Not all number sequences have a clean mathematical rule. Some sequences are defined by lookup tables (prime numbers, highly composite numbers) rather than by a simple formula. If the tool cannot identify a pattern, it will suggest the closest candidates and display the differences so you can investigate further. You can also try entering more terms to give the pattern detector more data to work with.
What is the difference between a sequence and a series? A sequence is an ordered list of numbers: 1, 4, 9, 16, 25... A series is the sum of the terms of a sequence: 1 + 4 + 9 + 16 + 25 = 55. The study of series involves determining whether the sum converges to a finite value (for infinite series) and finding closed-form expressions for partial sums. For arithmetic sequences, the partial sum is n/2 x (first term + last term).
Can the tool find the pattern if some terms are missing? The tool requires at least three consecutive terms to begin identifying a pattern, and five or more terms produce more reliable results. If you have gaps in your sequence, enter the terms you know and note which positions are missing. The tool can sometimes infer missing values if the pattern is clearly identified from the surrounding terms.
Reading the difference table
The tool reports successive differences because the pattern inside those differences identifies the sequence type. One table answers most of the questions people bring to a pattern finder.
| What stays constant | Sequence type | General term | Terms needed |
|---|---|---|---|
| First differences | Arithmetic | a(n) = a(1) + (n - 1)d | 3 |
| Ratio of consecutive terms | Geometric | a(n) = a(1) x r^(n-1) | 3 |
| Second differences | Quadratic | a(n) = An^2 + Bn + C | 4 |
| Third differences | Cubic | a(n) = An^3 + Bn^2 + Cn + D | 5 |
| A recurrence between terms | Fibonacci-type | a(n) = a(n-1) + a(n-2) | 4 |
Work down that table from the top and stop at the first row that fits. A sequence with constant first differences is arithmetic, and the later rows never apply. A sequence whose first differences look irregular but whose second differences are constant is quadratic, and it takes that second pass of subtraction to see it.
Worked example with an arithmetic sequence
Sequence: 7, 12, 17, 22, 27
First differences: 12 - 7 = 5, 17 - 12 = 5, 22 - 17 = 5, 27 - 22 = 5
The first difference is constant at 5, so the sequence is arithmetic with d = 5 and a first term of 7.
General term: a(n) = 7 + (n - 1) x 5 = 5n + 2
Check the fourth term: a(4) = 5 x 4 + 2 = 22, which matches the list. Check the fifth term: a(5) = 5 x 5 + 2 = 27, which matches the list.
The fortieth term is a(40) = 5 x 40 + 2 = 202.
The sum of the first 40 terms uses the arithmetic partial sum, S = (n / 2) x (first term + nth term). Here that is (40 / 2) x (7 + 202) = 20 x 209 = 4,180.
Worked example with a geometric sequence
Sequence: 3, 6, 12, 24, 48
First differences: 3, 6, 12, 24. Those are not constant, and they are not noise either. Each difference equals the term that follows the one it was subtracted from, which happens whenever the ratio is 2.
Ratio test: 6 / 3 = 2, 12 / 6 = 2, 24 / 12 = 2, 48 / 24 = 2
The ratio is constant at 2, so the sequence is geometric with r = 2 and a first term of 3.
General term: a(n) = 3 x 2^(n-1) Check the fifth term: a(5) = 3 x 2^4 = 3 x 16 = 48, which matches the list.
The twelfth term is a(12) = 3 x 2^11 = 3 x 2,048 = 6,144.
A ratio compounds, and compounding beats any constant step once you look far enough ahead. Compare the two sequences at term 40. The arithmetic sequence above reaches 202. A geometric sequence with the same first term of 7 and a ratio of 1.1 reaches 7 x 1.1^39 = 288.0. Raise the ratio to 1.5 and term 40 becomes 7 x 1.5^39 = 51,600,884. The first term fixes where a sequence starts; the ratio decides where it finishes.
Worked example with a cubic sequence
Sequence: 2, 9, 28, 65, 126
First differences: 7, 19, 37, 61 Second differences: 12, 18, 24 Third differences: 6, 6
The third difference is constant, so the sequence is cubic and its general term carries a 1 in front of n cubed.
For a cubic of the form a(n) = An^3 + Bn^2 + Cn + D, the constant third difference equals 6A. Here 6A = 6, so A = 1.
Test a(n) = n^3 + 1. Then a(1) = 1 + 1 = 2, a(2) = 8 + 1 = 9, a(3) = 27 + 1 = 28, a(4) = 64 + 1 = 65 and a(5) = 125 + 1 = 126. Every term matches the list, so the general term is a(n) = n^3 + 1 and the next term is a(6) = 216 + 1 = 217.
Where the differences rule comes from
The rule the tool applies is a standard result in finite difference calculus. If a sequence is generated by a polynomial of degree k, its kth differences are constant and every difference of higher order is zero.
That hands you a direct test with a fixed number of subtractions. Difference once for a straight line, twice for a quadratic, three times for a cubic and four times for a quartic. The number of subtractions you needed also tells you the degree, which is how the tool can name a family from five or six terms.
Two cautions come with the same result. The test needs enough terms, because a quadratic has no second difference until the fourth term exists and a cubic has no third difference until the fifth. Enter three terms and every family the tool reports is a guess dressed as an answer. Constant differences also identify a polynomial family without proving that the polynomial is the rule the sequence was built from. Any finite list of numbers fits a polynomial of some degree, so the useful reading is the simplest rule that fits, and that is the one the tool returns.
When no difference rule applies
Some sequences are defined by a lookup table rather than by a formula, and no amount of differencing will crack them. The prime numbers are the standard example: 2, 3, 5, 7, 11, 13 and onward forever, with no closed-form general term anyone has found. The digits of a constant behave the same way, and so do sequences that record a count of something, such as the number of divisors a number has.
The difference test still earns its keep on these. Feed in the primes and the differences come back as 1, 2, 2, 4, 2, 4, 2, 4, 6, an irregular run with no constant level anywhere. That negative result is information: it tells you to stop looking for a polynomial and to check a reference list instead.
Two habits keep a pattern hunt honest. Enter at least five or six terms so the tool has something to difference, and write down the rule you settle on next to the terms you used. A rule identified from four terms and tested against the fifth and sixth is worth far more than one asserted from four terms alone.
Also try these free tools:
Where the definitions come from
The difference test described above is the standard finite difference result for polynomial sequences, and it appears in any introductory text on numerical analysis or discrete mathematics. For sequences defined by a lookup rule rather than a formula, the reference is the On-Line Encyclopedia of Integer Sequences at https://oeis.org. Enter the first four or five terms of an unfamiliar sequence there and it will find matching entries, which is the fastest way to settle a sequence whose differences stay irregular.