About the Recursive Sequence Calculator
This recursive sequence calculator generates the terms of a sequence defined by a recurrence relation — a rule that gives each term from the ones before it. Type the rule using a(n-1), a(n-2) and a(n-3) for the previous terms and n for the index, enter the initial terms, and it lists up to 100 terms with their running sum, the ratio of consecutive terms and a graph.
It covers first-order rules such as a(n) = 2·a(n−1) + 1 or a(n) = a(n−1)/2 + 1/a(n−1), second-order rules such as the Fibonacci recurrence a(n−1) + a(n−2), third-order rules such as the Tribonacci sequence, and rules that depend on n itself, such as n·a(n−1) for factorials. The calculator detects the order from the highest a(n−k) you use and only asks for that many starting values.
Students use it to explore sequences in discrete math, precalculus and computer science; teachers use it to build tables; and anyone modelling loan balances, population steps or iterative algorithms can see how a rule behaves over many steps. Calculations use double-precision numbers, so very large terms (beyond about 10¹⁵) lose exact integer precision and are shown in scientific notation.
With the default inputs, the last term is 610. Change any value above to recalculate instantly.
How to use the recursive sequence calculator
- 1Type the rule using a(n-1), a(n-2), a(n-3) and n — for Fibonacci, a(n-1) + a(n-2).
- 2Choose whether the first index is n = 0 or n = 1.
- 3Enter as many initial terms as the rule’s order (one for a(n-1) only, two if it uses a(n-2)).
- 4Set how many terms to generate, up to 100.
- 5Read the last term, the sum and ratio, then check the table and graph.
Formula and method
A recurrence relation defines each term from earlier terms. The order k is the furthest back the rule looks: a(n−1) only is first order, a(n−2) makes it second order, a(n−3) third order. A k-th order rule needs exactly k starting values; after that the calculator applies the rule repeatedly, feeding in the newest k terms and the current index n.
The sum is the total of all generated terms, and the ratio a(N)/a(N−1) shows the long-run growth factor — for linear recurrences such as Fibonacci it approaches the dominant root of the characteristic equation (the golden ratio φ ≈ 1.618 for Fibonacci, ≈ 1.839 for Tribonacci). When successive terms stop changing, the sequence has reached a fixed point L with L = F(L).
- a(n)
- The n-th term of the sequence
- a(n−1), a(n−2), a(n−3)
- The previous one, two or three terms
- n
- Index of the term being computed
- k
- Order: how many earlier terms the rule uses (= starting values needed)
Worked examples
Fibonacci numbers: a(n) = a(n−1) + a(n−2)
Starting 1, 1, each term is the sum of the previous two: 1, 1, 2, 3, 5, 8, …, 377, 610. The sum of the first 15 terms is 1,596 (= F17 − 1), and 610/377 ≈ 1.61804 is already close to the golden ratio.
Arithmetic sequence: a(n) = a(n−1) + 3
Starting at 2 and adding 3 each time gives 2, 5, 8, …, 29 for the 10th term (2 + 9·3). The sum is 10·(2 + 29)/2 = 155.
Factorials: a(n) = n·a(n−1)
With a(1) = 1, a(2) = 2·1 = 2, a(3) = 3·2 = 6, and so on, so a(10) = 10! = 3,628,800. The sum 1! + 2! + … + 10! is 4,037,913.
Converging to √2: a(n) = a(n−1)/2 + 1/a(n−1)
From 1 the terms are 1.5, 1.41667, 1.414216, 1.41421356237…: the fixed point L = L/2 + 1/L gives L² = 2. This is the Babylonian square-root method, converging very quickly.
Tribonacci from n = 0
Starting 0, 0, 1, each term adds the previous three: 1, 2, 4, 7, 13, 24, … up to a(19) = 19,513. The ratio of consecutive terms approaches the Tribonacci constant ≈ 1.839.
Frequently asked questions
What is a recursive sequence?+
A recursive sequence defines each term using one or more earlier terms, plus some starting values. For example, a(1) = 1 and a(n) = 2·a(n−1) produces 1, 2, 4, 8, 16, … because each term doubles the one before.
What is the difference between a recursive and an explicit formula?+
A recursive formula builds each term from the previous ones, so you must compute every term in order. An explicit formula gives a(n) directly from n, such as a(n) = 2^(n−1), letting you jump straight to any term.
How many initial terms do I need?+
As many as the order of the recurrence. A rule using only a(n−1) needs one starting value; one using a(n−2) needs two (like Fibonacci’s 1, 1); one using a(n−3) needs three.
How do I find the limit of a recursive sequence?+
If the sequence converges to L, then L must satisfy L = F(L), so solve that equation. For a(n) = a(n−1)/2 + 1/a(n−1) this gives L² = 2. Generating terms here shows whether the sequence actually settles there.
Why does the ratio of Fibonacci numbers approach 1.618?+
The recurrence a(n) = a(n−1) + a(n−2) has characteristic equation x² = x + 1, whose larger root is the golden ratio φ = (1 + √5)/2 ≈ 1.618. That root dominates as n grows, so consecutive ratios approach φ.
Can I use n in the rule?+
Yes. Rules such as n·a(n−1) (factorials), a(n−1) + n (triangular numbers) or a(n−1) + 1/n² are allowed. The index starts at the first index you choose and increases by one per term.