← New search

Mathematics

Linear recurrence

A linear recurrence relation is an equation that defines a sequence where each term is a linear combination of preceding terms, usually with constant coefficients. It is a fundamental concept in discrete mathematics, algorithms, and physics, governing sequences such as the Fibonacci numbers. The order of a linear recurrence is the number of previous terms it depends on. Solutions are typically expressed using characteristic polynomials and closed-form expressions, linking the recurrence to linear algebra and generating functions.

k
Order of the recurrence
k
1

Definition and form

A linear recurrence with constant coefficients is an equation of the form an = c1 an−1 + c2 an−2 + … + ck an−k for n ≥ k, where the ci are constants and k is the order. The recurrence is homogeneous if the right-hand side has no additional term; otherwise it is nonhomogeneous. The first k values (initial conditions) uniquely determine the entire sequence. For example, the Fibonacci numbers satisfy Fn = Fn−1 + Fn−2 with F0=0, F1=1, a second-order linear recurrence.12

2

Solving linear recurrences

The characteristic polynomial of a homogeneous linear recurrence is p(x) = xk − c1 xk−1 − … − ck. Its roots determine the general solution: if the roots r1, … , rk are distinct, the sequence is an = α1 r1n + … + αk rkn, where the αi are constants fixed by initial conditions. Repeated roots introduce polynomial factors. For nonhomogeneous recurrences, a particular solution is added. This method is equivalent to solving a linear difference equation and is closely related to generating functions and the z-transform.34

3

Applications

Linear recurrences appear in combinatorial sequences (e.g., Fibonacci, Lucas, Pell numbers), analysis of algorithms (e.g., time complexity of divide-and-conquer algorithms like merge sort can be expressed as recurrences), population modeling, and signal processing. The linear recurrence is also used in cryptography (linear feedback shift registers) and in the study of continued fractions. In computer science, dynamic programming solutions often reduce to evaluating linear recurrences efficiently using matrix exponentiation.15

4

Lesser-known aspects

Beyond the standard theory, linear recurrences have deep connections to linear algebra: the companion matrix of the recurrence has eigenvalues equal to the roots of the characteristic polynomial. The matrix exponentiation method computes the nth term in O(k3 log n) time. For recurrences modulo a prime, the periodicity (Pisano period for Fibonacci) is studied. The generating function of a linear recurrence is a rational function, and the recurrence can be recovered from its denominator. The Skolem–Mahler–Lech theorem describes the set of zeros of a linear recurrence sequence. Also, linear recurrences with polynomial coefficients (linear difference equations) are far more complex and arise in special functions.26

Glossary

Order
The number of previous terms used in the recurrence.
Characteristic polynomial
The polynomial p(x) = x^k - c_1 x^{k-1} - ... - c_k, whose roots determine the solution form.
Homogeneous recurrence
A recurrence with no constant term; all terms are linear combinations of previous terms.