Next Number in a Sequence & Difference Table
Enter a prefix as decimals or fractions. Find the lowest-degree polynomial through the supplied terms, see whether a geometric rule also fits, and change the next value while preserving the complete prefix.
Explore what can come next in a sequence
Build a difference table, compare exact candidate rules, and see how the same prefix can continue in different ways.
Consecutive terms
Enter consecutive values starting at position 1. Separate terms with commas or spaces. Use decimals or fractions such as 3/4.
A quadratic polynomial matches all entered terms.
Next term at position 5
- Polynomial
- 25
- Adjusted polynomial
- 30
The adjusted polynomial keeps all entered terms and changes the polynomial’s next term by 5.
Continuations and difference rows
Shading marks continuation after the last entered term. Plot values from 1 to 239.
- Entered terms
- Polynomial
- Adjusted polynomial
Position 5 · continuation
- Polynomial
- 25
- Adjusted polynomial
- 30
Query at position 7
- Polynomial
- 49
- Adjusted polynomial
- 124
Review the exact difference table
Show all difference rows
Order 0 · entered terms
- 1
- 4
- 9
- 16
Order 1
- 3
- 5
- 7
Order 2
- 2
- 2
Order 3
- 0
View CSV text
How to use this calculator
- Enter two to 14 terms starting at position 1. Use commas or whitespace between consecutive values.
- Read the polynomial next term and a geometric candidate when it fits every entered term.
- Change the alternate next term to see how the same prefix can fit another polynomial. Inspect the continuation and difference order charts.
- Enter an optional query position and download the complete difference table and matching continuations as exact fractions.
The Formula
The mathematical logic powering this calculation is:
Let the N entered values be a₁ through a_N at positions 1 through N. The order-0 row contains the terms. Form each higher row by subtracting neighboring entries, later minus earlier. If c_j is the first entry in difference order j, the interpolating polynomial is P(n) = Σ c_j × C(n−1,j), j = 0 through N−1. Use C(u,0) = 1 and C(u,j) = u(u−1)⋯(u−j+1)/j!. This formula is defined at negative integer positions too. The last nonzero leading difference gives the degree, with a constant rule when all differences above order zero vanish.
The adjusted polynomial is P(n) + d × C(n−1,N). The added term vanishes at each entered position and equals d at N+1. Changing d shows how any finite prefix can have more than one continuation. If the first term is nonzero, a geometric candidate exists exactly when each term equals the previous one times the same ratio r = a₂/a₁. Then a_n = a₁r^(n−1). The zero-ratio rule is undefined at positions before 1. All-zero inputs leave the ratio undetermined.
Use 2–14 consecutive terms. Enter a signed decimal with up to 12 whole digits and six fractional places, or an integer fraction with components up to 12 digits and positive denominator. Separate terms with commas or whitespace. The optional query accepts integers from −100 to 100. The chart shows the observed prefix and the next four positions. Exact fractions determine all results, with compact rounded display for large or tiny values. Choosing a continuation requires a rule beyond the finite prefix.Worked Example
If you input:
- Terms: 1, 4, 9, 16
- Change to the next value: 5
- Query position: 7
Result:
The second differences are both 2. The lowest-degree polynomial is quadratic and gives next term 25. The alternate polynomial still matches all four inputs and gives 30. At position 7 the candidates give 49 and 124.
Frequently Asked Questions
Can a finite sequence have two valid next numbers?
Yes. Many rules can agree on every entered term and diverge later. The adjustable polynomial demonstrates that by changing the next value while preserving the prefix.
What do constant second differences mean?
A quadratic polynomial has constant second differences. If the supplied sequence is a prefix of that polynomial, its next values maintain that second difference.
How can a geometric and polynomial continuation both fit?
Equal nonzero ratios can identify a geometric rule. A finite set of distinct positions also has a polynomial interpolant. The two continuations can give different values after the entered prefix.
What does a singleton difference row show?
The final row always contains one value. The other rows and the leading differences determine the interpolating polynomial. A single entry does not independently establish a repeating difference.
What if the ratio is zero?
A nonzero first term followed only by zeros fits a zero-ratio geometric rule. That rule gives zero after position 1 and has no backward value before position 1.
Similar Calculators
Arithmetic Sequence & Missing Term Calculator
Recover an arithmetic sequence from two indexed terms. Find a missing term, the index of a target term, or all counts that give a target sum.
Summation & Series Explorer
Evaluate sigma notation with exact fractions. Explore indexed expressions, arithmetic and geometric series, partial sums, cancellation, remainders and CSV.
Derivative Graph & Finite Difference Calculator
Graph a polynomial derivative and compare forward, backward and centered steps. Separate exact truncation, sample rounding and subtraction error.
