Constant-recursive sequence

From testwiki
Jump to navigation Jump to search

Template:Short description

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

In mathematics, an infinite sequence of numbers s0,s1,s2,s3, is called constant-recursive if it satisfies an equation of the form

sn=c1sn1+c2sn2++cdsnd,

for all nd, where ci are constants. The equation is called a linear recurrence relation. The concept is also known as a linear recurrence sequence, linear-recursive sequence, linear-recurrent sequence, or a C-finite sequence.Template:Sfn

For example, the Fibonacci sequence

0,1,1,2,3,5,8,13,,

is constant-recursive because it satisfies the linear recurrence Fn=Fn1+Fn2: each number in the sequence is the sum of the previous two.Template:Sfn Other examples include the power of two sequence 1,2,4,8,16,, where each number is the sum of twice the previous number, and the square number sequence 0,1,4,9,16,25,. All arithmetic progressions, all geometric progressions, and all polynomials are constant-recursive. However, not all sequences are constant-recursive; for example, the factorial sequence 1,1,2,6,24,120, is not constant-recursive.

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. The Skolem problem, which asks for an algorithm to determine whether a linear recurrence has at least one zero, is an unsolved problem in mathematics.

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, for some fixed coefficients c1,c2,,cd ranging over the same domain as the sequence (integers, rational numbers, algebraic numbers, real numbers, or complex numbers). The equation is called a linear recurrence with constant coefficients of order d. The order of the sequence is the smallest positive integer d such that the sequence satisfies a recurrence of order d, or d=0 for the everywhere-zero sequence. Template:Citation needed

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.Template:SfnTemplate:Sfn[1]

Examples

Selected examples of integer constant-recursive sequences[2]
Name Order (d  ) First few values Recurrence (for nd ) Generating function OEIS
Zero sequence 0 0, 0, 0, 0, 0, 0, ... sn=0 01 Template:OEIS link
One sequence 1 1, 1, 1, 1, 1, 1, ... sn=sn1 11x Template:OEIS link
Characteristic function of {0} 1 1, 0, 0, 0, 0, 0, ... sn=0 11 Template:OEIS link
Powers of two 1 1, 2, 4, 8, 16, 32, ... sn=2sn1 112x Template:OEIS link
Powers of −1 1 1, −1, 1, −1, 1, −1, ... sn=sn1 11+x Template:OEIS link
Characteristic function of {1} 2 0, 1, 0, 0, 0, 0, ... sn=0 x1 Template:OEIS link
Decimal expansion of 1/6 2 1, 6, 6, 6, 6, 6, ... sn=sn1 1+5x1x Template:OEIS link
Decimal expansion of 1/11 2 0, 9, 0, 9, 0, 9, ... sn=sn2 9x1x2 Template:OEIS link
Nonnegative integers 2 0, 1, 2, 3, 4, 5, ... sn=2sn1sn2 x(1x)2 Template:OEIS link
Odd positive integers 2 1, 3, 5, 7, 9, 11, ... sn=2sn1sn2 1+x(1x)2 Template:OEIS link
Fibonacci numbers 2 0, 1, 1, 2, 3, 5, 8, 13, ... sn=sn1+sn2 x1xx2 Template:OEIS link
Lucas numbers 2 2, 1, 3, 4, 7, 11, 18, 29, ... sn=sn1+sn2 2x1xx2 Template:OEIS link
Pell numbers 2 0, 1, 2, 5, 12, 29, 70, ... sn=2sn1+sn2 x12xx2 Template:OEIS link
Powers of two interleaved with 0s 2 1, 0, 2, 0, 4, 0, 8, 0, ... sn=2sn2 112x2 Template:OEIS link
Inverse of 6th cyclotomic polynomial 2 1, 1, 0, −1, −1, 0, 1, 1, ... sn=sn1sn2 11x+x2 Template:OEIS link
Triangular numbers 3 0, 1, 3, 6, 10, 15, 21, ... sn=3sn13sn2+sn3 x(1x)3 Template:OEIS link

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.Template:Sfn

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. Template:Citation needed

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,.... Template:Citation needed

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). Template:Citation needed

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.[3][4] 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.[5] 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.Template:Sfn 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. Template:Citation needed

Other examples

The sequences of Jacobsthal numbers, Padovan numbers, Pell numbers, and Perrin numbersTemplate:Sfn 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

Template:Main Template:Float begin |-style="text-align:center;" | Fn=[01][1110]n[10]. Template:Float end

A sequence (sn)n=0 is constant-recursive of order less than or equal to 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].[6]

In terms of non-homogeneous linear recurrences

Template:Main Template:Float begin |- class="wikitable" ! Non-homogeneous !! Homogeneous |- align = "center" | sn=1+sn1 | sn=2sn1sn2 |- align = "center" | s0=0 | s0=0;s1=1 Template:Float end

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 obtainTemplate:Citation needed

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

In terms of generating functions

Template:Float begin |-style="text-align:center;" |n=0Fnxn=x1xx2. Template:Float end

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)=1.Template:Sfn Moreover, the order of the sequence is the minimum d such that it has such a form with deg q(x)d and deg p(x)<d.Template:Sfn

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:[7]Template:Sfn

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

where

bn=snc1sn1c2sn2cdsnd.Template:Sfn

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

In terms of sequence spaces

Template:Float begin |-align=center |{(an+b)n=0:a,b} Template:Float end

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.Template:SfnTemplate:Sfn

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.Template:SfnTemplate:Sfn

Closed-form characterization

Template:For

Template:Float begin |-align=center |Fn=15(1.618)n15(0.618)n Template:Float end

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

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

for all n0, where

  • The term zn is a sequence which is zero for all nd (where d is the order of the sequence);
  • The terms k1(n),k2(n),,ke(n) are complex polynomials; and
  • The terms r1,r2,,rk are distinct complex constants.Template:SfnTemplate:Sfn

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

For example, the Fibonacci number Fn is written in this form using Binet's formula:Template:Sfn

Fn=15φn15ψn,

where φ=(1+5)/21.61803 is the golden ratio and ψ=1/φ. These are the roots of the equation x2x1=0. In this case, e=2, zn=0 for all n, k1(n)=k2(n)=1/5 are both constant polynomials, r1=φ, and r2=ψ.

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.Template:Citation needed

The complex numbers r1,,rn are the roots of the characteristic polynomial of the recurrence:

xdc1xd1cd1xcd

whose coefficients are the same as those of the recurrence.Template:Sfn We call r1,,rn the characteristic roots of the recurrence. If the sequence consists of integers or rational numbers, the roots will be algebraic numbers. 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.[8]Template:Sfn

Closure properties

Examples

The sum of two constant-recursive sequences is also constant-recursive.Template:SfnTemplate:Sfn 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.Template:Sfn 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.Template:Sfn

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+eTemplate:Sfn
Term-wise product st (st)n=sntn 12πiγf(ζ)ζg(xζ)dζ[9][10] de[6]Template:Sfn
Cauchy product s*t (s*t)n=i=0nsitni f(x)g(x) d+eTemplate:Sfn
Left shift Ls (Ls)n=sn+1 f(x)s0x dTemplate:Sfn
Right shift Rs (Rs)n={sn1n10n=0 xf(x) d+1Template:Sfn
Cauchy inverse s(1) (s(1))n=i1++ik=ni1,,ik0(1)ksi1si2sik s0=1 1f(x) d+1Template:Sfn
Kleene star s(*) (s(*))n=i1++ik=ni1,,ik0si1si2sik s0=0 11f(x) d+1Template:Sfn

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.Template:Sfn 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).Template:Sfn

Behavior

Template:Main Template:Unsolved

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.[11]

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

Notable decision problems
Problem Description Status[6][12]
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.[6] On the other hand, the exact pattern which repeats after n>M is computable.[6][13] 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 algebraic sequences of order up to 4.[14][15][16] It is also known to be decidable for reversible integer sequences up to order 7, that is, sequences that may be continued backwards in the integers.[12]

Decidability results are also known under the assumption of certain unproven conjectures in number theory. For example, decidability is known for rational sequences of order up to 5 subject to the Skolem conjecture (also known as the exponential local-global principle). Decidability is also known for all simple rational sequences (those with simple characteristic polynomial) subject to the Skolem conjecture and the weak p-adic Schanuel conjecture.[17]

Degeneracy

Let r1,,rn be the characteristic roots of a constant recursive sequence s. We say that the sequence is degenerate if any ratio ri/rj is a root of unity, for ij. It is often easier to study non-degenerate sequences, in a certain sense one can reduce to this using the following theorem: if s has order d and is contained in a number field K of degree k over , then there is a constant M(k,d){exp(2d(3logd)1/2)if k=1,2kd+1if k2

such that for some MM(k,d) each subsequence sMn+ is either identically zero or non-degenerate.[18]

Generalizations

A D-finite or holonomic sequence is a natural generalization where the coefficients of the recurrence are allowed to be polynomial functions of n rather than constants.[19]

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.[20] 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. Template:Citation needed

Notes

Template:Reflist

References

Template:Refbegin

Template:Refend

  • Template:Cite web 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)