Binarios.org

Recurrence Relation Calculator

Generate sequence terms from recurrence coefficients and initial conditions. Explore linear recurrences, inspect the formula, and follow each calculation.

Calculate a Recurrence Sequence

Enter coefficients in order from the most recent previous term to the oldest previous term. Separate numbers with commas or spaces.

Example: 1, 1 represents an = an-1 + an-2.
Enter exactly one starting value per coefficient.
Choose from 1 to 500 terms, including the initial values.

Try an example

What Is a Recurrence Relation?

A recurrence relation defines a sequence by specifying how to calculate a new term from one or more earlier terms. Initial conditions supply the starting values needed to begin the calculation.

General linear recurrence

an = c1an-1 + c2an-2 + ... + ckan-k

Here:

Example: Fibonacci recurrence

an = an-1 + an-2

With initial conditions a0 = 0 and a1 = 1:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...

Each new term is the sum of the two terms immediately before it. This calculator can generate Fibonacci numbers, Lucas numbers, and many other linear recurrence sequences using custom coefficients.

How to use the calculator

  1. Enter the recurrence coefficients from newest previous term to oldest.
  2. Enter the same number of initial values as coefficients.
  3. Choose how many total terms you want, including the initial values.
  4. Select Calculate Sequence to see the generated terms and calculations.

More examples

Sequence Coefficients Initial conditions First terms
Fibonacci 1, 1 0, 1 0, 1, 1, 2, 3, 5, ...
Lucas 1, 1 2, 1 2, 1, 3, 4, 7, 11, ...
Custom second order 2, 3 1, 2 1, 2, 7, 20, 61, ...
Alternating signs -1 1 1, -1, 1, -1, 1, ...
Third order 1, 1, 1 0, 0, 1 0, 0, 1, 1, 2, 4, ...

Frequently Asked Questions

What is the order of a recurrence relation?

The order is the number of previous terms used to calculate the next term. A second-order recurrence uses two previous terms and requires two initial values.

Can I use negative coefficients?

Yes. Negative and zero coefficients are supported, as are decimal coefficients and initial values.

Can I calculate Fibonacci or Lucas numbers?

Yes. Use coefficients 1, 1. For Fibonacci numbers, enter initial conditions 0, 1. For Lucas numbers, enter 2, 1.

Are the results exact?

The calculator uses floating-point arithmetic. Many small integer sequences will display as expected, but very large terms and some decimal calculations can be approximate.

How many terms can I generate?

You can request up to 500 terms per calculation. Extremely fast-growing sequences may exceed the supported numeric range before reaching that limit.

Related Math Calculators