Linear recurrence relations
Definition and structure
A linear recurrence relation defines each term of a sequence as a linear combination of previous terms, with constant coefficients. The general form is:
where are constants and is some function of .
The order of the relation equals the largest gap between indices. If the most distant term you reference is , you have an order- relation.
Several well-known sequences are defined this way:
- Fibonacci sequence: (order 2)
- Arithmetic sequences: (order 1, non-homogeneous when )
- Geometric sequences: (order 1, homogeneous)
These relations appear throughout combinatorics, computer science, and applied math whenever you need to model sequential processes like population growth or financial compounding. The main goal is usually to find a closed-form expression for , and the standard tools for doing so are characteristic equations, generating functions, and matrix methods.
Identifying key elements

Initial conditions and coefficients
Initial conditions pin down which specific sequence satisfies the recurrence. The number of initial conditions you need equals the order of the relation. A second-order recurrence like the Fibonacci sequence needs two: .
Coefficients are the constant multipliers . They can be positive, negative, or zero, and they heavily influence how the sequence behaves:
- with produces the sequence (linear growth, not exponential, since the characteristic equation has a repeated root at )
- produces an alternating sequence that flips sign each step
The non-homogeneous part , when present, is treated separately from the coefficients of previous terms. For example, in , the constant 3 is the non-homogeneous term, making this an arithmetic sequence with common difference 3.
Getting these elements right matters because they determine both your solution method and the long-term behavior of the sequence.
Generating sequence terms

Calculation process
To compute terms from a recurrence, follow these steps:
-
Write down the recurrence, coefficients, and initial conditions. Example: with .
-
Compute the next term by substituting the most recent known values.
-
Use the correct number of previous terms for the order. A second-order relation always needs two previous terms; a third-order relation needs three.
-
Watch the starting index. If the sequence begins at instead of , adjust accordingly so you don't accidentally reference an undefined term.
-
Verify by back-substitution. Plug your computed terms back into the recurrence to confirm they satisfy it. Catching arithmetic errors early saves a lot of pain.
For generating many terms at once, iterative computation (a simple loop in Python or similar) is more efficient than recursion, which can be extremely slow for relations like Fibonacci due to redundant calculations.
Homogeneous vs non-homogeneous relations
Key differences and solution approaches
The distinction between these two types drives your entire solution strategy.
A homogeneous linear recurrence has . Every term is built purely from previous terms with no outside forcing function:
The Fibonacci recurrence is homogeneous.
A non-homogeneous linear recurrence has . There's an extra term that depends on (or is a nonzero constant):
For example, is non-homogeneous because of the term.
Solving homogeneous relations uses the characteristic equation directly. For , you form:
The roots and give the general solution , and you use initial conditions to find and .
Solving non-homogeneous relations requires two pieces:
- The homogeneous solution (solve the associated homogeneous recurrence, i.e., set ).
- A particular solution that accounts for , typically found via the method of undetermined coefficients. You guess a form for the particular solution based on the shape of (polynomial, exponential, etc.), then solve for the unknown constants.
The complete solution is the sum of these two parts.
Long-term behavior also differs. Homogeneous relations tend toward exponential growth, decay, or oscillation depending on the characteristic roots. Non-homogeneous relations can exhibit additional patterns imposed by . For instance, grows quadratically (the particular solution is a quadratic polynomial in ), even though the homogeneous part alone would be constant.