Constant-recursive sequence

From HandWiki
Short description: Infinite sequence of numbers satisfying a linear equation
The Fibonacci sequence is constant-recursive: each element of the sequence is the sum of the previous two.
Hasse diagram of some subclasses of constant-recursive sequences, ordered by inclusion
Unsolved problem in mathematics:
Is there an algorithm to test whether a constant-recursive sequence has a zero?
(more unsolved problems in mathematics)

In mathematics and theoretical computer science, a constant-recursive sequence is an infinite sequence of numbers in which each number in the sequence is equal to a fixed linear combination of one or more of its immediate predecessors. The concept is variously known as a linear recurrence sequence, linear-recursive sequence, linear-recurrent sequence, a C-finite sequence,[1] or a solution to a linear recurrence with constant coefficients.

A prototypical example is the Fibonacci sequence 0,1,1,2,3,5,8,13,, in which each number is the sum of the previous two.[2] The power of two sequence 1,2,4,8,16, is also constant-recursive because each number is the sum of twice the previous number. The square number sequence 0,1,4,9,16,25, is also constant-recursive. However, not all sequences are constant-recursive; for example, the factorial sequence 1,1,2,6,24,120, is not constant-recursive. All arithmetic progressions, all geometric progressions, and all polynomials are constant-recursive.

Formally, a sequence of numbers s0,s1,s2,s3, is constant-recursive if it satisfies a recurrence relation

sn=c1sn1+c2sn2++cdsnd,

where ci are constants. For example, the Fibonacci sequence satisfies the recurrence relation Fn=Fn1+Fn2, where Fn is the nth Fibonacci number.

Constant-recursive sequences are studied in combinatorics and the theory of finite differences. They also arise in algebraic number theory, due to the relation of the sequence to polynomial roots; in the analysis of algorithms, as the running time of simple recursive functions; and in the theory of formal languages, 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.

The Skolem–Mahler–Lech theorem 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 an algorithm to determine whether a linear recurrence has at least one zero, remains unsolved.

Definition

A constant-recursive sequence is any sequence of integers, rational numbers, algebraic numbers, real numbers, or complex numbers s0,s1,s2,s3, (written as (sn)n=0 as a shorthand) satisfying a formula of the form

sn=c1sn1+c2sn2++cdsnd,

for all nd, where ci are constants. (This equation is called a linear recurrence with constant coefficients of order d.) The order of the constant-recursive sequence is the smallest d1 such that the sequence satisfies a formula of the above form, or d=0 for the everywhere-zero sequence.

The d coefficients c1,c2,,cd must be coefficients ranging over the same domain as the sequence (integers, rational numbers, algebraic numbers, real numbers, or complex numbers). For example for a rational constant-recursive sequence, si and ci must be rational numbers.

The definition above allows eventually-periodic sequences such as 1,0,0,0, and 0,1,0,0,. Some authors require that cd0, which excludes such sequences.[3][4]

Examples

Selected examples of integer constant-recursive sequences
Name Order (d  ) First few values Recurrence (for nd ) Generating function OEIS
Zero sequence 0 0, 0, 0, 0, 0, 0, ... sn=0 01 A000004
One sequence 1 1, 1, 1, 1, 1, 1, ... sn=sn1 11x A000012
Characteristic function of {0} 1 1, 0, 0, 0, 0, 0, ... sn=0 11 A000007
Powers of two 1 1, 2, 4, 8, 16, 32, ... sn=2sn1 112x A000079
Powers of −1 1 1, −1, 1, −1, 1, −1, ... sn=sn1 11+x A033999
Characteristic function of {1} 2 0, 1, 0, 0, 0, 0, ... sn=0 x1 A063524
Decimal expansion of 1/6 2 1, 6, 6, 6, 6, 6, ... sn=sn1 1+5x1x A020793
Decimal expansion of 1/11 2 0, 9, 0, 9, 0, 9, ... sn=sn2 9x1x2 A010680
Nonnegative integers 2 0, 1, 2, 3, 4, 5, ... sn=2sn1sn2 x(1x)2 A001477
Odd positive integers 2 1, 3, 5, 7, 9, 11, ... sn=2sn1sn2 1+x(1x)2 A005408
Fibonacci numbers 2 0, 1, 1, 2, 3, 5, 8, 13, ... sn=sn1+sn2 x1xx2 A000045
Lucas numbers 2 2, 1, 3, 4, 7, 11, 18, 29, ... sn=sn1+sn2 2x1xx2 A000032
Pell numbers 2 0, 1, 2, 5, 12, 29, 70, ... sn=2sn1+sn2 x12xx2 A000129
Powers of two interleaved with 0s 2 1, 0, 2, 0, 4, 0, 8, 0, ... sn=2sn2 112x2 A077957
Inverse of 6th cyclotomic polynomial 2 1, 1, 0, −1, −1, 0, 1, 1, ... sn=sn1sn2 11x+x2 A010892
Triangular numbers 3 0, 1, 3, 6, 10, 15, 21, ... sn=3sn13sn2+sn3 x(1x)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 Fn=Fn1+Fn2 with F0=0,F1=1. For example, F2=F1+F0=1+0=1 and F6=F5+F4=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 L0=2 and L1=1. More generally, every Lucas sequence is constant-recursive of order 2.[2]

Arithmetic progressions

For any a and any r0, the arithmetic progression a,a+r,a+2r, is constant-recursive of order 2, because it satisfies sn=2sn1sn2. Generalizing this, see polynomial sequences below.

Geometric progressions

For any a0 and r, the geometric progression a,ar,ar2, is constant-recursive of order 1, because it satisfies sn=rsn1. This includes, for example, the sequence 1, 2, 4, 8, 16, ... as well as the rational number sequence 1,12,14,18,116,....

Eventually periodic sequences

A sequence that is eventually periodic with period length is constant-recursive, since it satisfies sn=sn for all nd, where the order 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

A sequence defined by a polynomial sn=a0+a1n+a2n2++adnd is constant-recursive. The sequence satisfies a recurrence of order d+1 (where d is the degree of the polynomial), with coefficients given by the corresponding element of the binomial transform.[5][6] The first few such equations are

sn=1sn1 for a degree 0 (that is, constant) polynomial,
sn=2sn11sn2 for a degree 1 or less polynomial,
sn=3sn13sn2+1sn3 for a degree 2 or less polynomial, and
sn=4sn16sn2+4sn31sn4 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.[7] Any sequence of d+1 integer, real, or complex values can be used as initial conditions for a constant-recursive sequence of order d+1. If the initial conditions lie on a polynomial of degree d1 or less, then the constant-recursive sequence also obeys a lower order equation.

Enumeration of words in a regular language

Let L be a regular language, and let sn be the number of words of length n in L. Then (sn)n=0 is constant-recursive.[8] For example, sn=2n for the language of all binary strings, sn=1 for the language of all unary strings, and sn=Fn+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 Σ={a} over the semiring (,+,×) (which is in fact a ring, and even a field) is constant-recursive.

Other examples

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

Non-examples

The factorial sequence 1,1,2,6,24,120,720, is not constant-recursive. More generally, every constant-recursive function is asymptotically bounded by an exponential function (see #Closed-form characterization) and the factorial sequence grows faster than this.

The Catalan sequence 1,1,2,5,14,42,132, is not constant-recursive. This is because the generating function of the Catalan numbers is not a rational function (see #Equivalent definitions).

Equivalent definitions

In terms of matrices

Main page: Companion matrix
Fn=[01][1110]n[10].
{{{caption}}}

A sequence (sn)n=0 is constant-recursive of order d if and only if it can be written as

sn=uAnv

where u is a 1×d vector, A is a d×d matrix, and v is a d×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, v can be taken to be the first d values of the sequence, A the linear transformation that computes sn+1,sn+2,,sn+d from sn,sn+1,,sn+d1, and u the vector [0,0,,0,1].[9]

In terms of non-homogeneous linear recurrences

Non-homogeneous Homogeneous
sn=1+sn1 sn=2sn1sn2
s0=0 s0=0;s1=1
{{{caption}}}

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

sn=c1sn1+c2sn2++cdsnd+c

where c is an additional constant. Any sequence satisfying a non-homogeneous linear recurrence is constant-recursive. This is because subtracting the equation for sn1 from the equation for sn yields a homogeneous recurrence for snsn1, from which we can solve for sn to obtain

sn=(c1+1)sn1+(c2c1)sn2++(cdcd1)sndcdsnd1.

In terms of generating functions

n=0Fnxn=x1xx2.
{{{caption}}}

A sequence is constant-recursive precisely when its generating function

n=0snxn=s0+s1x1+s2x2+s3x3+

is a rational function p(x)q(x), where p and q are polynomials and q(0)0. 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.[10] [11]

The explicit derivation of the generating function in terms of the linear recurrence is

n=0snxn=b0+b1x1+b2x2++bd1xd11c1x1c2x2cdxd,

where

bn=snc1sn1c2sn2cdsnd.

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

In terms of sequence spaces

{(an+b)n=0:a,b}
{{{caption}}}

A sequence (sn)n=0 is constant-recursive if and only if the set of sequences

{(sn+r)n=0:r0}

is contained in a sequence space (vector space of sequences) whose dimension is finite. That is, (sn)n=0 is contained in a finite-dimensional subspace of closed under the left-shift operator.[12]

This characterization is because the order-d linear recurrence relation can be understood as a proof of linear dependence between the sequences (sn+r)n=0 for r=0,,d. An extension of this argument shows that the order of the sequence is equal to the dimension of the sequence space generated by (sn+r)n=0 for all r.[13]

Closed-form characterization

Fn=15(1.618)n15(0.618)n
{{{caption}}}

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

sn=zn+k1(n)r1n+k2(n)r2n++ke(n)ren,

where

  • zn is a sequence which is zero for all nd (the order of the sequence);
  • k1(n),k2(n),,ke(n) are complex polynomials; and
  • r1,r2,,rk are distinct complex constants.

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

For example, the Fibonacci number Fn is written in this form using Binet's formula:[16]

Fn=15φn15ψn,

where φ=1+521.61803 is the golden ratio and ψ=1φ, both roots of the equation x2x1=0. In this case, e=2, zn=0 for all n, k1(n)=k2(n)=15 (constant polynomials), r1=φ, and r2=ψ. 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 r1,,rn are the roots of the characteristic polynomial (or "auxiliary polynomial") of the recurrence:

xdc1xd1cd1xcd

whose coefficients are the same as those of the recurrence.[17] If the d roots r1,r2,,rd are all distinct, then the polynomials ki(n) are all constants, which can be determined from the initial values of the sequence. If the roots of the characteristic polynomial are not distinct, and ri is a root of multiplicity m, then ki(n) in the formula has degree m1. For instance, if the characteristic polynomial factors as (xr)3, with the same root r occurring three times, then the nth term is of the form sn=(a+bn+cn2)rn.[18][19]

The term zn is only needed when cd0; if cd=0 then it corrects for the fact that some initial values may be exceptions to the general recurrence. In particular, zn=0 for all nd, the order of the sequence.

Closure properties

Examples

The sum of two constant-recursive sequences is also constant-recursive.[20][21] For example, the sum of sn=2n and tn=n is un=2n+n (1,3,6,11,20,), which satisfies the recurrence un=4un15un2+2un3. The new recurrence can be found by adding the generating functions for each sequence.

Similarly, the product of two constant-recursive sequences is constant-recursive.[20] For example, the product of sn=2n and tn=n is un=n2n (0,2,8,24,64,), which satisfies the recurrence un=4un14un2.

The left-shift sequence un=sn+1 and the right-shift sequence un=sn1 (with u0=0) are constant-recursive because they satisfy the same recurrence relation. For example, because sn=2n is constant-recursive, so is un=2n+1.

List of operations

In general, constant-recursive sequences are closed under the following operations, where s=(sn)n,t=(tn)n denote constant-recursive sequences, f(x),g(x) are their generating functions, and d,e are their orders, respectively.

Operations on constant-recursive sequences
Operation Definition Requirement Generating function equivalent Order
Term-wise sum s+t (s+t)n=sn+tn f(x)+g(x) d+e[20]
Term-wise product st (st)n=sntn de[9][20]
Cauchy product s*t (s*t)n=i=0nsitni f(x)g(x) d+e
Left shift Ls (Ls)n=sn+1 f(x)s0x d
Right shift Rs (Rs)n={sn1n10n=0 xf(x) d+1
Cauchy inverse s(1) (s(1))n=i1++ik=ni1,,ik0(1)ksi1si2sik s0=1 1f(x) max(2d1,2)
Kleene star s(*) (s(*))n=i1++ik=ni1,,ik0si1si2sik s0=0 11f(x) max(2d1,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 s0=1 for Cauchy inverse is necessary for the case of integer sequences, but can be replaced by s00 if the sequence is over any field (rational, algebraic, real, or complex numbers).

Behavior

Main pages: Skolem–Mahler–Lech theorem and Skolem problem

Zeros

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

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 sn 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.[9] Given such an encoding for sequences sn, the following problems can be studied:

Notable decision problems
Problem Description Status[9][23]
Existence of a zero (Skolem problem) On input (sn)n=0, is sn=0 for some n? Open
Infinitely many zeros On input (sn)n=0, is sn=0 for infinitely many n? Decidable
Eventually all zero On input (sn)n=0, is sn=0 for all sufficiently large n? Decidable
Positivity On input (sn)n=0, is sn>0 for all n? Open
Eventual positivity On input (sn)n=0, is sn>0 for all sufficiently large n? Open

Because the square of a constant-recursive sequence sn2 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 sn=c for some n reduces to existence-of-a-zero for the sequence snc. As a second example, for sequences in the real numbers, weak positivity (is sn0 for all n?) reduces to positivity of the sequence sn (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 n>M, the zeros are repeating; however, the value of M is not known to be computable, so this does not lead to a solution to the existence-of-a-zero problem.[9] On the other hand, the exact pattern which repeats after n>M is computable.[9][24] 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,[9] and for a restricted set of sequences up to order 7.[23]

Generalizations

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

Notes

  1. Kauers & Paule 2010, p. 63.
  2. 2.0 2.1 2.2 Kauers & Paule 2010, p. 70.
  3. Halava, Vesa; Harju, Tero; Hirvensalo, Mika; Karhumäki, Juhani (2005), Skolem's Problem – On the Border between Decidability and Undecidability, p. 1 
  4. Kauers & Paule 2010, p. 66.
  5. Boyadzhiev, Boyad (2012). "Close Encounters with the Stirling Numbers of the Second Kind". Math. Mag. 85 (4): 252–266. doi:10.4169/math.mag.85.4.252. https://www.maa.org/sites/default/files/pdf/upload_library/2/Boyadzhiev-2013.pdf. 
  6. Riordan, John (1964). "Inverse Relations and Combinatorial Identities" (in en). The American Mathematical Monthly 71 (5): 485–498. doi:10.1080/00029890.1964.11992269. ISSN 0002-9890. https://www.tandfonline.com/doi/full/10.1080/00029890.1964.11992269. 
  7. Jordan, Charles; Jordán, Károly (1965) (in en). Calculus of Finite Differences. American Mathematical Soc.. pp. 9–11. ISBN 978-0-8284-0033-6. https://books.google.com/books?id=3RfZOsDAyQsC&dq=theory+of+finite+differences&pg=PA1.  See formula on p.9, top.
  8. Kauers & Paule 2010, p. 81.
  9. 9.0 9.1 9.2 9.3 9.4 9.5 9.6 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, 7550, Heidelberg: Springer-Verlag, pp. 21–28, doi:10.1007/978-3-642-33512-9_3 .
  10. Martino, Ivan; Martino, Luca (2013-11-14). "On the variety of linear recurrences and numerical semigroups" (in en). Semigroup Forum 88 (3): 569–574. doi:10.1007/s00233-013-9551-2. ISSN 0037-1912. 
  11. Kauers & Paule 2010, p. 74.
  12. Kauers & Paule 2010, p. 67.
  13. Kauers & Paule 2010, p. 69.
  14. Brousseau 1971, pp. 28-34, Lesson 5.
  15. Kauers & Paule 2010, pp. 68-70.
  16. Brousseau 1971, p. 16, Lesson 3.
  17. Brousseau 1971, p. 28, Lesson 5.
  18. 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 .
  19. Brousseau 1971, pp. 29-31, Lesson 5.
  20. 20.0 20.1 20.2 20.3 Kauers & Paule 2010, p. 71.
  21. Brousseau 1971, p. 37, Lesson 6.
  22. Lech, C. (1953), "A Note on Recurring Series", Arkiv för Matematik 2 (5): 417–421, doi:10.1007/bf02590997, Bibcode1953ArM.....2..417L 
  23. 23.0 23.1 Lipton, Richard; Luca, Florian; Nieuwveld, Joris; Ouaknine, Joël; Purser, David; Worrell, James (2022-08-04). "On the Skolem Problem and the Skolem Conjecture". Proceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science. LICS '22 (New York, NY, USA: Association for Computing Machinery): 1–9. doi:10.1145/3531130.3533328. ISBN 978-1-4503-9351-5. https://dl.acm.org/doi/10.1145/3531130.3533328. 
  24. Berstel, Jean; Mignotte, Maurice (1976). "Deux propriétés décidables des suites récurrentes linéaires" (in fr). Bulletin de la Société Mathématique de France 104: 175–184. doi:10.24033/bsmf.1823. 

References