# Constant-recursive sequence

The Fibonacci sequence is constant-recursive: each element of the sequence is the sum of the previous two.
Hasse diagram of some subsets of constant-recursive sequences, ordered by inclusion

In mathematics and theoretical computer science, a constant-recursive sequence (also known as a linear recurrence sequence, linear-recursive sequence, linear-recurrent sequence, or C-finite sequence) is an infinite sequence of numbers in which each number in the sequence is equal to a linear combination of one or more of its immediate predecessors.

The most famous example of a constant-recursive sequence is the Fibonacci sequence, in which each number is the sum of the previous two; formally, we say that it satisfies a linear recurrence with constant coefficients

${\displaystyle F_{n}=F_{n-1}+F_{n-2},}$

where ${\displaystyle F_{n}}$ is the ${\displaystyle n}$th Fibonacci number. Generalizing this idea, a constant-recursive sequence ${\displaystyle s_{0},s_{1},s_{2},s_{3},\ldots }$ satisfies a formula of the form

${\displaystyle s_{n}=c_{1}s_{n-1}+c_{2}s_{n-2}+\dots +c_{d}s_{n-d},}$

where ${\displaystyle c_{i}}$ are constants. In addition to the Fibonacci sequence, constant-recursive sequences include many other well-known sequences, such as arithmetic progressions, geometric progressions, and polynomials.

Constant-recursive sequences arise in combinatorics and the theory of finite differences; in algebraic number theory, due to the relation of the sequence to the roots of a polynomial; in the analysis of algorithms in the running time of simple recursive functions; and in formal language theory, where they count strings up to a given length in a regular language. Constant-recursive sequences are closed under important mathematical operations such as term-wise addition, term-wise multiplication, and Cauchy product. A seminal result is the Skolem–Mahler–Lech theorem, which states that the zeros of a constant-recursive sequence have a regularly repeating (eventually periodic) form. On the other hand, the Skolem problem, which asks for algorithm to determine whether a linear recurrence has at least one zero, remains one of the unsolved problems in mathematics.

## Definition

An order-d homogeneous linear recurrence relation is an equation of the form

${\displaystyle s_{n}=c_{1}s_{n-1}+c_{2}s_{n-2}+\dots +c_{d}s_{n-d},}$

where the d coefficients ${\displaystyle c_{1},c_{2},\dots ,c_{d}}$ are coefficients ranging over the integers, rational numbers, algebraic numbers, real numbers, or complex numbers.

A sequence ${\displaystyle s_{0},s_{1},s_{2},\dots }$ (written as ${\displaystyle (s_{n})_{n=0}^{\infty }}$ as a shorthand) ranging over the same domain as the coefficients, is constant-recursive if there is an order-d homogeneous linear recurrence with constant coefficients that it satisfies for all ${\displaystyle n\geq d}$. This definition allows eventually-periodic sequences such as ${\displaystyle 1,0,0,0,\ldots }$ and ${\displaystyle 0,1,0,0,\ldots }$. Some authors require that ${\displaystyle c_{d}\neq 0}$, which excludes such sequences.[1][2]

The order of a constant-recursive sequence is the smallest ${\displaystyle d\geq 1}$ such that the sequence satisfies an order-d homogeneous linear recurrence, or ${\displaystyle d=0}$ for the everywhere-zero sequence.

## Equivalent definitions

### In terms of matrices

 ${\displaystyle F_{n}={\begin{bmatrix}0&1\end{bmatrix}}{\begin{bmatrix}1&1\\1&0\end{bmatrix}}^{n}{\begin{bmatrix}1\\0\end{bmatrix}}.}$
Definition of the Fibonacci sequence using matrices.

A sequence ${\displaystyle (s_{n})_{n=0}^{\infty }}$ is constant-recursive of order ${\displaystyle \leq d}$ if and only if it can be written as

${\displaystyle s_{n}=uA^{n}v}$

where ${\displaystyle u}$ is a ${\displaystyle 1\times d}$ vector, ${\displaystyle A}$ is a ${\displaystyle d\times d}$ matrix, and ${\displaystyle v}$ is a ${\displaystyle d\times 1}$ vector, where the elements come from the same domain (integers, rational numbers, algebraic numbers, real numbers, or complex numbers) as the original sequence. Specifically, ${\displaystyle v}$ can be taken to be the first ${\displaystyle d}$ values of the sequence, ${\displaystyle A}$ the linear transformation that computes ${\displaystyle s_{n+1},s_{n+2},\ldots ,s_{n+d}}$ from ${\displaystyle s_{n},s_{n+1},\ldots ,s_{n+d-1}}$, and ${\displaystyle u}$ the vector ${\displaystyle 0,0,\ldots ,0,1}$.[3]

### In terms of vector spaces

A sequence ${\displaystyle (s_{n})_{n=0}^{\infty }}$ is constant-recursive if and only if the set of sequences

${\displaystyle \left\{(s_{n+r})_{n=0}^{\infty }:r\geq 0\right\}}$

is contained in a vector space whose dimension is finite, i.e. a finite-dimensional subspace of ${\displaystyle \mathbb {C} ^{\mathbb {N} }}$ closed under the left-shift operator. This is because the order-${\displaystyle d}$ linear recurrence relation can be understood as a proof of linear dependence between the vectors ${\displaystyle (s_{n+r})_{n=0}^{\infty }}$ for ${\displaystyle r=0,\ldots ,d}$. An extension of this argument shows that the order of the sequence is equal to the dimension of the vector space generated by ${\displaystyle (s_{n+r})_{n=0}^{\infty }}$ for all ${\displaystyle r}$.

### In terms of non-homogeneous linear recurrences

Non-homogeneous Homogeneous
${\displaystyle s_{n}=1+s_{n-1}}$ ${\displaystyle s_{n}=2s_{n-1}-s_{n-2}}$
${\displaystyle s_{0}=0}$ ${\displaystyle s_{0}=0;s_{1}=1}$
Definition of the sequence of natural numbers ${\displaystyle s_{n}=n}$, using a non-homogeneous recurrence and the equivalent homogeneous version.

A non-homogeneous linear recurrence is an equation of the form

${\displaystyle s_{n}=c_{1}s_{n-1}+c_{2}s_{n-2}+\dots +c_{d}s_{n-d}+c}$

where ${\displaystyle c}$ is an additional constant. Any sequence satisfying a non-homogeneous linear recurrence is constant-recursive. This is because subtracting the equation for ${\displaystyle s_{n-1}}$ from the equation for ${\displaystyle s_{n}}$ yields a homogeneous recurrence for ${\displaystyle s_{n}-s_{n-1}}$, from which we can solve for ${\displaystyle s_{n}}$ to obtain

{\displaystyle {\begin{aligned}s_{n}=&(c_{1}+1)s_{n-1}\\&+(c_{2}-c_{1})s_{n-2}+\dots +(c_{d}-c_{d-1})s_{n-d}\\&-c_{d}s_{n-d-1}.\end{aligned}}}

### In terms of generating functions

 ${\displaystyle \sum _{n=0}^{\infty }F_{n}x^{n}={\frac {x}{1-x-x^{2}}}.}$
Definition of the Fibonacci sequence using a generating function.

A sequence is constant-recursive precisely when its generating function

${\displaystyle \sum _{n=0}^{\infty }s_{n}x^{n}=s_{0}+s_{1}x^{1}+s_{2}x^{2}+s_{3}x^{3}+\cdots }$

is a rational function ${\displaystyle {\frac {p(x)}{q(x)}}}$, where ${\displaystyle p}$ and ${\displaystyle q}$ are polynomials. The denominator is the polynomial obtained from the auxiliary polynomial by reversing the order of the coefficients, and the numerator is determined by the initial values of the sequence.[4] The explicit derivation of the generating function in terms of the linear recurrence is

${\displaystyle \sum _{n=0}^{\infty }s_{n}x^{n}={\frac {b_{0}+b_{1}x^{1}+b_{2}x^{2}+\dots +b_{d-1}x^{d-1}}{1-c_{1}x^{1}-c_{2}x^{2}-\dots -c_{d}x^{d}}},}$

where

${\displaystyle b_{n}=s_{n}-c_{1}s_{n-1}-c_{2}s_{n-2}-\dots -c_{d}s_{n-d}.}$

It follows from the above that the denominator here must be a polynomial not divisible by ${\displaystyle x}$ (and in particular nonzero).

## Examples

Selected examples of integer constant-recursive sequences
Name Order (${\displaystyle d}$) First few values Recurrence (for ${\displaystyle n\geq d}$) Generating function OEIS
Zero sequence 0 0, 0, 0, ... ${\displaystyle s_{n}=0}$ ${\displaystyle {\frac {0}{1}}}$ A000004
One sequence 1 1, 1, 1, ... ${\displaystyle s_{n}=s_{n-1}}$ ${\displaystyle {\frac {1}{1-x}}}$ A000012
Characteristic function of ${\displaystyle \{0\}}$ 1 1, 0, 0, 0, ... ${\displaystyle s_{n}=0}$ ${\displaystyle {\frac {1}{1}}}$ A000007
Powers of two 1 1, 2, 4, 8, 16, ... ${\displaystyle s_{n}=2s_{n-1}}$ ${\displaystyle {\frac {1}{1-2x}}}$ A000079
Powers of -1 1 1, -1, 1, -1, ... ${\displaystyle s_{n}=-s_{n-1}}$ ${\displaystyle {\frac {1}{1+x}}}$ A033999
Characteristic function of ${\displaystyle \{1\}}$ 2 0, 1, 0, 0, 0, ... ${\displaystyle s_{n}=0}$ ${\displaystyle {\frac {x}{1}}}$ A063524
Decimal expansion of 1/6 2 1, 6, 6, 6, ... ${\displaystyle s_{n}=s_{n-1}}$ ${\displaystyle {\frac {1+5x}{1-x}}}$ A020793
Decimal expansion of 1/11 2 0, 9, 0, 9, ... ${\displaystyle s_{n}=s_{n-2}}$ ${\displaystyle {\frac {9x}{1-x^{2}}}}$ A010680
Nonnegative integers 2 0, 1, 2, 3, 4, ... ${\displaystyle s_{n}=2s_{n-1}-s_{n-2}}$ ${\displaystyle {\frac {x}{(1-x)^{2}}}}$ A001477
Odd positive integers 2 1, 3, 5, 7, 9, ... ${\displaystyle s_{n}=2s_{n-1}-s_{n-2}}$ ${\displaystyle {\frac {1+x}{(1-x)^{2}}}}$ A005408
Fibonacci numbers 2 0, 1, 1, 2, 3, 5, 8, 13, ... ${\displaystyle s_{n}=s_{n-1}+s_{n-2}}$ ${\displaystyle {\frac {x}{1-x-x^{2}}}}$ A000045
Lucas numbers 2 2, 1, 3, 4, 7, 11, ... ${\displaystyle s_{n}=s_{n-1}+s_{n-2}}$ ${\displaystyle {\frac {2-x}{1-x-x^{2}}}}$ A000032
Pell numbers 2 0, 1, 2, 5, 12, 29, ... ${\displaystyle s_{n}=2s_{n-1}+s_{n-2}}$ ${\displaystyle {\frac {x}{1-2x-x^{2}}}}$ A000129
Powers of two interleaved with 0s 2 1, 0, 2, 0, 4, 0, 8, 0, ... ${\displaystyle s_{n}=2s_{n-2}}$ ${\displaystyle {\frac {1}{1-2x^{2}}}}$ A077957
Inverse of 6th cyclotomic polynomial 2 1, 1, 0, -1, -1, 0, 1, 1, ... ${\displaystyle s_{n}=s_{n-1}-s_{n-2}}$ ${\displaystyle {\frac {1}{1-x+x^{2}}}}$ A010892
Triangular numbers 3 0, 1, 3, 6, 10, 15, ... ${\displaystyle s_{n}=3s_{n-1}-3s_{n-2}+s_{n-3}}$ ${\displaystyle {\frac {x}{(1-x)^{3}}}}$ A000217

### Fibonacci and Lucas sequences

The sequence 0, 1, 1, 2, 3, 5, 8, 13, ... of Fibonacci numbers is constant-recursive of order 2 because it satisfies the recurrence ${\displaystyle F_{n}=F_{n-1}+F_{n-2}}$ with ${\displaystyle F_{0}=0,F_{1}=1}$. For example, ${\displaystyle F_{2}=F_{1}+F_{0}=1+0=1}$ and ${\displaystyle F_{6}=F_{5}+F_{4}=5+3=8}$. The sequence 2, 1, 3, 4, 7, 11, ... of Lucas numbers satisfies the same recurrence as the Fibonacci sequence but with initial conditions ${\displaystyle L_{0}=2}$ and ${\displaystyle L_{1}=1}$. More generally, every Lucas sequence is constant-recursive of order 2.

### Arithmetic progressions

For any ${\displaystyle a}$ and any ${\displaystyle r\neq 0}$, the arithmetic progression ${\displaystyle a,a+r,a+2r,\ldots }$ is constant-recursive of order 2, because it satisfies ${\displaystyle s_{n}=2s_{n-1}-s_{n-2}}$. Generalizing this, see polynomial sequences below.

### Geometric progressions

For any ${\displaystyle a\neq 0}$ and ${\displaystyle r}$, the geometric progression ${\displaystyle a,ar,ar^{2},\ldots }$ is constant-recursive of order 1, because it satisfies ${\displaystyle s_{n}=rs_{n-1}}$. This includes, for example, the sequence 1, 2, 4, 8, 16, ... as well as the rational number sequence ${\displaystyle 1,{\frac {1}{2}},{\frac {1}{4}},{\frac {1}{8}},{\frac {1}{16}},...}$.

### Eventually periodic sequences

A sequence that is eventually periodic with period length ${\displaystyle \ell }$ is constant-recursive, since it satisfies ${\displaystyle s_{n}=s_{n-\ell }}$ for all ${\displaystyle n\geq d}$, where the order ${\displaystyle d}$ is the length of the initial segment including the first repeating block. Examples of such sequences are 1, 0, 0, 0, ... (order 1) and 1, 6, 6, 6, ... (order 2).

### Polynomial sequences

For any polynomial ${\displaystyle s_{n}}$, the sequence of its values is a constant-recursive sequence. If the degree of the polynomial is ${\displaystyle d}$, the sequence satisfies a recurrence of order ${\displaystyle d+1}$, with coefficients given by the corresponding element of the binomial transform.[5] The first few such equations are

${\displaystyle s_{n}=1\cdot s_{n-1}}$ for a degree 0 (that is, constant) polynomial,
${\displaystyle s_{n}=2\cdot s_{n-1}-1\cdot s_{n-2}}$ for a degree 1 or less polynomial,
${\displaystyle s_{n}=3\cdot s_{n-1}-3\cdot s_{n-2}+1\cdot s_{n-3}}$ for a degree 2 or less polynomial, and
${\displaystyle s_{n}=4\cdot s_{n-1}-6\cdot s_{n-2}+4\cdot s_{n-3}-1\cdot s_{n-4}}$ for a degree 3 or less polynomial.

A sequence obeying the order-d equation also obeys all higher order equations. These identities may be proved in a number of ways, including via the theory of finite differences.[6] Any sequence of ${\displaystyle d+1}$ integer, real, or complex values can be used as initial conditions for a constant-recursive sequence of order ${\displaystyle d+1}$. If the initial conditions lie on a polynomial of degree ${\displaystyle d-1}$ or less, then the constant-recursive sequence also obeys a lower order equation.

### Enumeration of words in a regular language

Let ${\displaystyle L}$ be a regular language, and let ${\displaystyle s_{n}}$ be the number of words of length ${\displaystyle n}$ in ${\displaystyle L}$. Then ${\displaystyle (s_{n})_{n=0}^{\infty }}$ is constant-recursive. For example, ${\displaystyle s_{n}=2^{n}}$ for the language of all binary strings, ${\displaystyle s_{n}=1}$ for the language of all unary strings, and ${\displaystyle s_{n}=F_{n+2}}$ for the language of all binary strings that do not have two consecutive ones. More generally, any function accepted by a weighted automaton over the unary alphabet ${\displaystyle \Sigma =\{a\}}$ over the semiring ${\displaystyle (\mathbb {R} ,+,\times )}$ is constant-recursive.

### Other examples

The sequences of Jacobsthal numbers, Padovan numbers, Pell numbers, and Perrin numbers are constant-recursive.

## Closed-form characterization

Constant-recursive sequences admit the following unique closed form characterization using exponential polynomials: every constant-recursive sequence can be written in the form

${\displaystyle s_{n}=z_{n}+k_{1}(n)r_{1}^{n}+k_{2}(n)r_{2}^{n}+\cdots +k_{e}(n)r_{e}^{n},}$

where

• ${\displaystyle z_{n}}$ is a sequence which is zero for all ${\displaystyle n\geq d}$ (the order of the sequence);
• ${\displaystyle k_{1}(n),k_{2}(n),\ldots ,k_{e}(n)}$ are complex polynomials; and
• ${\displaystyle r_{1},r_{2},\ldots ,r_{k}}$ are distinct complex number constants.

This characterization is exact: every sequence of complex numbers that can be written in the above form is constant-recursive.

For example, the Fibonacci number ${\displaystyle F_{n}}$ is written in this form using Binet's formula:

${\displaystyle F_{n}={\frac {1}{\sqrt {5}}}\varphi ^{n}+{\frac {1}{\sqrt {5}}}\psi ^{n},}$

where ${\displaystyle \varphi ={\frac {1+{\sqrt {5}}}{2}}\approx 1.61803\ldots }$ is the golden ratio and ${\displaystyle \psi ={\frac {-1}{\varphi }}}$, both roots of the equation ${\displaystyle x^{2}-x-1=0}$. In this case, ${\displaystyle e=2}$, ${\displaystyle z_{n}=0}$ for all ${\displaystyle n}$, ${\displaystyle k_{1}(n)=k_{2}(n)={\frac {1}{\sqrt {5}}}}$ (constant polynomials), ${\displaystyle r_{1}=\varphi }$, and ${\displaystyle r_{2}=\psi }$. Notice that though the original sequence was over the integers, the closed form solution involves real or complex roots. In general, for sequences of integers or rationals, the closed formula will use algebraic numbers.

The complex numbers ${\displaystyle r_{1},\ldots ,r_{n}}$ are derived as the roots of the characteristic polynomial (or "auxiliary polynomial") of the recurrence:

${\displaystyle x^{d}-c_{1}x^{d-1}-\dots -c_{d-1}x-c_{d}}$

whose coefficients are the same as those of the recurrence. If the ${\displaystyle d}$ roots ${\displaystyle r_{1},r_{2},\dots ,r_{d}}$ are all distinct, then the polynomials ${\displaystyle k_{i}(n)}$ are all constants, which can be determined from the initial values of the sequence. The term ${\displaystyle z_{n}}$ is only needed when ${\displaystyle c(d)\neq 0}$; if ${\displaystyle c(d)=0}$ then it corrects for the fact that some initial values may be exceptions to the general recurrence. In particular, ${\displaystyle z_{n}=0}$ for all ${\displaystyle n\geq d}$, the order of the sequence.

In the general case where the roots of the characteristic polynomial are not necessarily distinct, and ${\displaystyle r_{i}}$ is a root of multiplicity ${\displaystyle m}$, the term ${\displaystyle r_{i}^{n}}$ is multiplied by a degree-${\displaystyle (m-1)}$ polynomial in ${\displaystyle n}$ (i.e. ${\displaystyle k_{i}(n)}$ in the formula has degree ${\displaystyle m}$). For instance, if the characteristic polynomial factors as ${\displaystyle (x-r)^{3}}$, with the same root r occurring three times, then the ${\displaystyle n}$th term is of the form

${\displaystyle s_{n}=(a+bn+cn^{2})r^{n}.}$[7]

## Closure properties

Constant-recursive sequences are closed under the following operations, where ${\displaystyle (s_{n}),(t_{n})}$ denote constant-recursive sequences, ${\displaystyle f(x),g(x)}$ are their generating functions, and ${\displaystyle d,e}$ are their orders, respectively.

Operations on constant-recursive sequences
Operation Definition Requirement Generating function equivalent Order
Term-wise sum ${\displaystyle (s_{n})+(t_{n})}$ ${\displaystyle s_{n}+t_{n}}$ ${\displaystyle s(x)+t(x)}$ ${\displaystyle \leq d+e}$
Term-wise product ${\displaystyle (s_{n})\cdot (t_{n})}$ ${\displaystyle s_{n}\cdot t_{n}}$ ${\displaystyle \leq d\cdot e}$[3]
Cauchy product ${\displaystyle (s_{n})*(t_{n})}$ ${\displaystyle \sum _{i=0}^{n}s_{i}t_{n-i}}$ ${\displaystyle f(x)g(x)}$ ${\displaystyle \leq d+e}$
Left shift ${\displaystyle L(s_{n})}$ ${\displaystyle s_{n+1}}$ ${\displaystyle {\frac {f(x)-s_{0}}{x}}}$ ${\displaystyle \leq d}$
Right shift ${\displaystyle R(s_{n})}$ ${\displaystyle {\begin{cases}s_{n-1}&n\geq 1\\0&n=0\end{cases}}}$ ${\displaystyle xf(x)}$ ${\displaystyle \leq d+1}$
Cauchy inverse ${\displaystyle (s_{n})^{(-1)}}$ ${\displaystyle s_{0}=1}$ ${\displaystyle {\frac {1}{f(x)}}}$ ${\displaystyle \leq \max(2d-1,2)}$
Kleene star ${\displaystyle (s_{n})^{(*)}}$ ${\displaystyle \sum _{i_{1}+\dots +i_{k}=n}s_{i_{1}}s_{i_{2}}\cdots s_{i_{k}}}$ ${\displaystyle s_{0}=0}$ ${\displaystyle {\frac {1}{1-f(x)}}}$ ${\displaystyle \leq \max(2d-1,2)}$

The closure under term-wise addition and multiplication follows from the closed-form characterization in terms of exponential polynomials. The closure under Cauchy product follows from the generating function characterization. The requirement ${\displaystyle s_{0}=1}$ for Cauchy inverse is necessary for the case of integer sequences, but can be replaced by ${\displaystyle s_{0}\neq 0}$ if the sequence is over any field (rational, algebraic, real, or complex numbers).

## Behavior

### Zeros

Despite simple local dynamics, constant-recursive functions exhibit complex global behavior. Define a zero of a constant-recursive sequence to be a nonnegative integer ${\displaystyle n}$ such that ${\displaystyle s_{n}=0}$. The Skolem–Mahler–Lech theorem states that the zeros of the sequence are eventually repeating: there exists constants ${\displaystyle M}$ and ${\displaystyle N}$ such that for all ${\displaystyle n>M}$, ${\displaystyle s_{n}=0}$ if and only if ${\displaystyle s_{n+N}=0}$. This result holds for a constant-recursive sequence over the complex numbers, or more generally, over any field of characteristic zero.[8]

### Decision problems

The pattern of zeros in a constant-recursive sequence can also be investigated from the perspective of computability theory. To do so, the description of the sequence ${\displaystyle s_{n}}$ must be given a finite description; this can be done if the sequence is over the integers or rational numbers, or even over the algebraic numbers.[3] Given such an encoding for sequences ${\displaystyle s_{n}}$, the following problems can be studied:

Notable decision problems
Problem Description Status (2021)
Existence of a zero (Skolem problem) On input ${\displaystyle (s_{n})_{n=0}^{\infty }}$, is ${\displaystyle s_{n}=0}$ for some ${\displaystyle n}$? Open
Infinitely many zeros On input ${\displaystyle (s_{n})_{n=0}^{\infty }}$, is ${\displaystyle s_{n}=0}$ for infinitely many ${\displaystyle n}$? Decidable
Positivity On input ${\displaystyle (s_{n})_{n=0}^{\infty }}$, is ${\displaystyle s_{n}>0}$ for all ${\displaystyle n}$? Open
Eventual positivity On input ${\displaystyle (s_{n})_{n=0}^{\infty }}$, is ${\displaystyle s_{n}>0}$ for all sufficiently large ${\displaystyle n}$? Open

Because the square of a constant-recursive sequence ${\displaystyle s_{n}^{2}}$ is still constant-recursive (see closure properties), the existence-of-a-zero problem in the table above reduces to positivity, and infinitely-many-zeros reduces to eventual positivity. Other problems also reduce to those in the above table: for example, whether ${\displaystyle s_{n}=c}$ for some ${\displaystyle n}$ reduces to existence-of-a-zero for the sequence ${\displaystyle s_{n}-c}$. As a second example, for sequences in the real numbers, weak positivity (is ${\displaystyle s_{n}\geq 0}$ for all ${\displaystyle n}$?) reduces to positivity of the sequence ${\displaystyle -s_{n}}$ (because the answer must be negated, this is a Turing reduction).

The Skolem-Mahler-Lech theorem would provide answers to some of these questions, except that its proof is non-constructive. It states that for all ${\displaystyle n>M}$, the zeros are repeating; however, the value of ${\displaystyle M}$ is not known to be computable, so this does not lead to a solution to the existence-of-a-zero problem.[3] On the other hand, the exact pattern which repeats after ${\displaystyle n>M}$ is computable.[3][9] This is why the infinitely-many-zeros problem is decidable: just determine if the infinitely-repeating pattern is empty.

Decidability results are known when the order of a sequence is restricted to be small. For example, the Skolem problem is decidable for sequences of order up to 4.[3]

## Generalizations

• A holonomic sequence is a natural generalization where the coefficients of the recurrence are allowed to be polynomial functions of ${\displaystyle n}$ rather than constants.
• A ${\displaystyle k}$-regular sequence satisfies a linear recurrences with constant coefficients, but the recurrences take a different form. Rather than ${\displaystyle s_{n}}$ being a linear combination of ${\displaystyle s_{m}}$ for some integers ${\displaystyle m}$ that are close to ${\displaystyle n}$, each term ${\displaystyle s_{n}}$ in a ${\displaystyle k}$-regular sequence is a linear combination of ${\displaystyle s_{m}}$ for some integers ${\displaystyle m}$ whose base-${\displaystyle k}$ representations are close to that of ${\displaystyle n}$. Constant-recursive sequences can be thought of as ${\displaystyle 1}$-regular sequences, where the base-1 representation of ${\displaystyle n}$ consists of ${\displaystyle n}$ copies of the digit ${\displaystyle 1}$.

• "OEIS Index Rec". OEIS index to a few thousand examples of linear recurrences, sorted by order (number of terms) and signature (vector of values of the constant coefficients)
• Brousseau, Alfred (1971). Linear Recursion and Fibonacci Sequences. Fibonacci Association.
• Graham, Ronald L.; Knuth, Donald E.; Patashnik, Oren (1994). Concrete Mathematics: A Foundation for Computer Science (2 ed.). Addison-Wesley. ISBN 978-0-201-55802-9.

## References

1. ^ Kauers, Manuel; Paule, Peter (2010-12-01). The Concrete Tetrahedron: Symbolic Sums, Recurrence Equations, Generating Functions, Asymptotic Estimates. Springer Vienna. p. 66. ISBN 978-3-7091-0444-6.
2. ^ Halava, Vesa; Harju, Tero; Hirvensalo, Mika; Karhumäki, Juhani (2005), Skolem's Problem – On the Border between Decidability and Undecidability, p. 1, CiteSeerX 10.1.1.155.2606, retrieved 2021-11-28
3. Ouaknine, Joël; Worrell, James (2012), "Decision problems for linear recurrence sequences", Reachability Problems: 6th International Workshop, RP 2012, Bordeaux, France, September 17–19, 2012, Proceedings, Lecture Notes in Computer Science, vol. 7550, Heidelberg: Springer-Verlag, pp. 21–28, doi:10.1007/978-3-642-33512-9_3, MR 3040104.
4. ^ Martino, Ivan; Martino, Luca (2013-11-14). "On the variety of linear recurrences and numerical semigroups". Semigroup Forum. 88 (3): 569–574. arXiv:1207.0111. doi:10.1007/s00233-013-9551-2. ISSN 0037-1912. S2CID 119625519.
5. ^ Boyadzhiev, Boyad (2012). "Close Encounters with the Stirling Numbers of the Second Kind" (PDF). Math. Mag. 85 (4): 252–266. arXiv:1806.09468. doi:10.4169/math.mag.85.4.252. S2CID 115176876.
6. ^ Jordan, Charles; Jordán, Károly (1965). Calculus of Finite Differences. American Mathematical Soc. pp. 9–11. ISBN 978-0-8284-0033-6. See formula on p.9, top.
7. ^ Greene, Daniel H.; Knuth, Donald E. (1982), "2.1.1 Constant coefficients – A) Homogeneous equations", Mathematics for the Analysis of Algorithms (2nd ed.), Birkhäuser, p. 17.
8. ^ Lech, C. (1953), "A Note on Recurring Series", Arkiv för Matematik, 2 (5): 417–421, doi:10.1007/bf02590997
9. ^ Berstel, Jean; Mignotte, Maurice (1976). "Deux propriétés décidables des suites récurrentes linéaires". Bulletin de la Société Mathématique de France (in French). 104: 175–184. doi:10.24033/bsmf.1823.