Sequence
analyzer.
Paste a list of numbers to get its nth-term rule, the next terms and the working.
- Next term
- 37
- Term 12
- 145
- Sum of the 5 terms
- 60
The second differences are all 2, so the rule is a polynomial of degree 2 and the terms grow like n².
Look up a term
a₁₂ = 145
401 is term 20.
Terms against n
Drag the point to pick a termThe 5 terms entered and the next 5 from the rule (the amber points: 37, 50, 65, 82, 101), plotted against n. The highlighted point is term 12, 145.
Difference table
| Row | Values | All equal |
|---|---|---|
| Terms | 2, 5, 10, 17, 26 | No |
| First differences | 3, 5, 7, 9 | No |
| Second differences | 2, 2, 2 | Yes |
| Third differences | 0, 0 | Yes |
| Fourth differences | 0 | One value |
Terms entered and the next five
| n | aₙ | From |
|---|---|---|
| 1 | 2 | Entered |
| 2 | 5 | Entered |
| 3 | 10 | Entered |
| 4 | 17 | Entered |
| 5 | 26 | Entered |
| 6 | 37 | Rule |
| 7 | 50 | Rule |
| 8 | 65 | Rule |
| 9 | 82 | Rule |
| 10 | 101 | Rule |
Working
- 1First differences: subtract each number from the next3, 5, 7, 9
- 2Second differences are all equal2, 2, 2
- 3Newton’s form: the first number of each row times a binomial coefficientaₙ = 2 + 3·C(n − 1, 1) + 2·C(n − 1, 2)
- 4Multiply out into powers of n, with exact fractionsaₙ=n²+1
- 5Check: put n = 1 to 5 into the rule2, 5, 10, 17, 26, the terms entered
How it's worked out
The tool tries six kinds of rule in a fixed order and keeps the first one that fits every term exactly: constant, arithmetic, geometric, a polynomial of degree 2 to 4, a rule built from the two terms before, and a power of n. The letter n is the position of a term, so the first number you type is .
Arithmetic. The same number d is added each time. OpenStax calls d the common difference.
Geometric. Each term is the one before times the same ratio r. The tool only tests this when no term is 0, since you cannot divide by 0.
Polynomial. Subtract each term from the next to get the first differences, then do the same to those, and so on. That triangle of numbers is the difference table. When the numbers in row k are all equal, the terms come from a polynomial of degree k. Newton's forward-difference form then rebuilds the rule from the first number in each row.
Here is the first number in row k, and is a binomial coefficient: the number of ways to pick k items from n − 1. Multiplying out gives the rule in powers of n. For the squares 1, 4, 9 and 16, the second differences are 2, 2, and the rule comes out as aₙ = n².
Two terms before. When no polynomial of degree 4 or less fits, the tool tests whether each term is p times the one before plus q times the one before that. It solves for p and q from the first four terms, then checks every later term. The Fibonacci numbers pass with aₙ = 1·aₙ₋₁ + 1·aₙ₋₂.
A polynomial of degree k needs at least k + 2 terms, so that one term is left over to test the fit. Four terms are enough for a quadratic and five for a cubic.
Worked examples
Maya counts handshakes at a meeting
Maya notes how many handshakes happen when everyone greets everyone once: 0, 1, 3, 6, 10 for 1 to 5 people. The first differences are 1, 2, 3, 4, and the second differences are all 1, so the rule is quadratic. The decimal form is aₙ = 0.5n² − 0.5n, and the exact form is easier to read:
With 12 people there are 66 handshakes. Going the other way, 45 handshakes means term 10, so 10 people. These are the triangular numbers, shifted by one place because her list starts with 1 person and 0 handshakes.
Leo plans the seats in a sloped hall
The front rows of a hall hold 4, 9, 14, 19, 24 seats. Each row adds 5, so the rule is arithmetic: aₙ = 4 + (n − 1)·5 = 5n − 1. Row 12 holds 59 seats.
Leo wonders whether some row holds exactly 401 seats. It does not, because 401 − 4 is not a multiple of 5. The first row with more is row 81, which holds 404.
Sam tests a puzzle that looks like doubling
A puzzle book lists 1, 2, 4, 8, 16, 31. The first five numbers alone read as doubling: the tool calls 1, 2, 4, 8, 16 geometric and predicts 32 next. The sixth number, 31, breaks that, and the fourth differences are all 1, so the rule is quartic.
The next term is 57. The doubling guess of 32 is not a term at all: the first term past it is term 7. This is the largest number of regions you get by joining n points on a circle with straight lines, and OEIS lists 57 after 31 too.
Reading your result
n starts at 1. The first number you type is term 1. If your book counts from term 0, put n + 1 wherever the rule has n, or add the missing first term to your list.
The next terms are a forecast. They come from the rule that fits, and they are only right if the list keeps following it. The tool prefers the simplest rule in its order, so a list that fits a ratio is never reported as a quartic.
No simple rule can mean a typo. The primes 2, 3, 5, 7, 11, 13 get "No simple pattern", which is correct: no rule of these six kinds makes them. But type 18 in place of 17 in 2, 5, 10, 17, 26 and the first differences become 3, 5, 8, 8, with a jump where the typo sits. Read the difference table before you trust or reject a list.
Exact or decimal. A coefficient such as 0.041667 is shown as a fraction when one with a bottom of 1,000 or less matches it, here one twenty-fourth. When none does, the decimal stays, so a rule with a coefficient like 0.3 typed as 0.33 is read as it was typed.
Common mistakes
- Trusting four terms for a cubic. Any four numbers fit some cubic exactly, so four terms cannot test one. The tool waits for five terms before it reports a cubic and six for a quartic.
- Counting the wrong row. The degree is the number of the row that is constant, not the number of rows in the table. Constant second differences mean a quadratic.
- Halving the second difference for every rule. The coefficient of n² is half the constant second difference only for a quadratic. For a cubic, the third difference is 6 times the coefficient of n³.
- Mixing up the ratio and the difference. 5, 10, 20, 40, 80 has differences that double, which can look like a polynomial at first. Its ratios are all 2, and the tool reports aₙ = 5 · 2ⁿ⁻¹.
Questions people ask
Sources
- OpenStax, College Algebra 2e, section 9.2, Arithmetic Sequences
- OpenStax, College Algebra 2e, section 9.3, Geometric Sequences
- Thangarajah, Mathematical Reasoning (Mount Royal University), section 3.4, Finite Difference Calculus, LibreTexts
- OEIS A000217, Triangular numbers
- OEIS A000127, Maximal number of regions obtained by joining n points around a circle