Logo

MonoCalc

/

Recursive Sequence Calculator

Math

Presets

Options

Formula used
a(n) = 1·a(n-1) + 1·a(n-2)

Seeds: a(0) = 0, a(1) = 1

Growth classification

Exponential growth

Magnitude is growing rapidly and without bound.

Computed with exact Big-Integer arithmetic

a(n) over n = 0..14

Sequence Table

na(n)a(n)/a(n-1)Partial Sum
000
111
211.00002
322.00004
431.50007
551.666712
681.600020
7131.625033
8211.615454
9341.619088
10551.6176143
11891.6182232
121441.6180376
132331.6181609
143771.6180986

About This Tool

Recursive Sequence Calculator – Generate Any Recurrence Relation

A recurrence relation defines each term of a sequence as a function of one or more preceding terms, plus one or more seed values to get started. Fibonacci's a(n) = a(n-1) + a(n-2) is the most famous example, but recurrences show up constantly in computer science (analyzing recursive algorithms), finance (recursive interest and deposit schedules), and dynamical systems (chaotic maps). This calculator generates any recurrence of order 1 to 3, jumps directly to a specific term, tracks partial sums and consecutive-term ratios, and automatically classifies the sequence's long-term behavior.

Recurrence Order and Seed Terms

The order of a recurrence is how many prior terms each new term depends on. A 1st-order recurrence like a(n) = 1.05·a(n-1) + 10 needs one seed, a(0). A 2nd-order recurrence like Fibonacci needs two seeds, a(0) and a(1). A 3rd-order recurrence such as the Tribonacci sequence, a(n) = a(n-1) + a(n-2) + a(n-3), needs three. Enter exactly as many seed values as the selected order requires — the calculator iterates forward from there, computing each new term in constant time per step.

Linear Shortcuts vs. Custom Formulas

Most recurrences encountered in coursework and finance are linear: a(n) = c1·a(n-1) + c2·a(n-2) + ... + d. For these, the coefficient fields (c1, c2, c3, and the constant d) are a fast way to describe the recurrence without typing an expression. For anything else — nonlinear growth, chaotic maps like the logistic equation a(n) = r·a(n-1)·(1-a(n-1)), or recurrences that also reference the index n — switch to the custom formula mode and write the expression directly using a(n-1), a(n-2), and a(n-3) as needed.

Safe Formula Evaluation

Custom formulas are never passed to JavaScript's eval. Instead, each expression is parsed into a syntax tree and checked against a strict whitelist of allowed tokens — the index n, the permitted prior-term references, and a fixed set of standard math functions like sin, sqrt, and abs. Any other identifier is rejected before evaluation ever runs, so the input box can't be used to execute arbitrary code.

Exact Results with Big-Integer Mode

Floating-point numbers lose precision once a value exceeds Number.MAX_SAFE_INTEGER (about 9 quadrillion). For whole-number linear recurrences — Fibonacci, Tribonacci, Lucas numbers, and similar — turning on Big-Integer Mode switches the engine to native BigInt arithmetic, so even the 200th or 500th term comes back exact, digit for digit. This mode also supports an optional modulo, useful for competitive-programming style problems that ask for a huge term reduced modulo a large prime.

Partial Sums, Ratios, and Growth Classification

Alongside each generated term, the results table shows the cumulative sum of all terms so far and the ratio of each term to the one before it — useful for spotting convergence, such as the Fibonacci ratio's well-known drift toward the golden ratio, φ ≈ 1.618. The calculator also auto-labels the sequence's overall behavior — constant, convergent, exponential growth, decaying toward zero, oscillating, or chaotic — based on the trend across the last several computed terms.

Jumping Directly to a Term

If you only need one far-out value, like the 200th term of a recurrence, there's no need to scroll through a long table. Switch to Evaluate a specific term mode, enter the index, and the calculator iterates only as far as that term before returning the result.

When to use this tool
Use the Recursive Sequence Calculator to verify recurrence-relation homework, explore recursive algorithm growth rates, model recursive interest schedules, or experiment with chaotic maps. For fixed Fibonacci-only or arithmetic/geometric-only work, the dedicated Fibonacci, Arithmetic, and Geometric Sequence Calculators offer a more focused interface.

Frequently Asked Questions

Is the Recursive Sequence Calculator free?

Yes, Recursive Sequence Calculator is totally free :)

Can I use the Recursive Sequence Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Recursive Sequence Calculator?

Yes, any data related to Recursive Sequence Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Recursive Sequence Calculator work?

Enter a recurrence order (1st, 2nd, or 3rd), the seed term(s), and either linear coefficients (a(n) = c1·a(n-1) + c2·a(n-2) + ... + d) or a custom formula referencing a(n-1), a(n-2), a(n-3), and n. The tool then iterates forward term by term to build the sequence, so it works for any recurrence — not just Fibonacci-style ones.

What's the difference between the linear and custom formula modes?

Linear mode is a shortcut for recurrences of the form a(n) = c1·a(n-1) + c2·a(n-2) + ... + d — just fill in the coefficients, no formula typing required. Custom formula mode accepts any expression built from a(n-1), a(n-2), a(n-3), n, and standard math functions, so it can also express nonlinear recurrences like the logistic map.

Is the custom formula input safe to use?

Yes. Formulas are parsed and validated against a strict whitelist of allowed variables (n, a(n-1), a(n-2), a(n-3)) and math functions — there is no eval() or arbitrary code execution. Any unrecognized token is rejected with an error before anything is evaluated.

How large a term can I compute without floating-point errors?

Enable Big-Integer Mode for linear, whole-number recurrences (like Fibonacci or Tribonacci) to get exact results with no precision loss, even for terms far beyond Number.MAX_SAFE_INTEGER. Custom formulas that use non-integer math (like the logistic map) always use standard floating-point precision.

What does the growth classification label mean?

It's an automatic, heuristic read of the sequence's long-term behavior based on the last several terms — labels like "Exponential growth", "Convergent", "Decaying toward zero", or "Oscillating". It's a helpful indicator, not a formal proof, especially for chaotic or borderline sequences.

Can I jump straight to a specific term without generating the whole list?

Yes — switch to "Evaluate a specific term" mode and enter the index you want. The calculator iterates only up to that term (capped at 100,000 for performance) instead of rendering every intermediate value in a table.