GuessRecurrence - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


LREtools

  

MinimalRecurrence

  

find the recurrence of proved minimal order for a holonomic sequence

  

SumDecompose

  

write a holonomic sequence as a sum of sequences that satisfy lower order recurrences when possible

  

GuessRecurrence

  

guess a recurrence for a sequence given by a finite list of terms

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

MinimalRecurrence(R, dvar, init)

SumDecompose(R, dvar, init, Values)

GuessRecurrence(v, dvar, offset, Minimize)

Parameters

R

-

linear recurrence relation

dvar

-

dependent variable

init

-

set of initial conditions

Values

-

(optional) name; when specified, it is assigned a procedure that gives terms for each summand sequence

v

-

list of terms

offset

-

(optional) offset of a sequence (can be omitted if the offset is 0)

Minimize

-

(optional) literal; if specified, GuessRecurrence runs a part of MinimalRecurrence

Description

• 

A sequence u0, u1, u2, ... is holonomic if it satisfies a linear homogeneous recurrence relation with polynomial or rational function coefficients. Given a recurrence, the dependent variable, and sufficiently many initial terms to define a sequence, the command MinimalRecurrence computes the recurrence of provably minimal order that holds for all but finitely many terms. Key to the proof are generalized exponents, from which degree bounds are be computed that are used to prove that no lower order recurrence will be missed.

• 

For a holonomic sequence un, given by a recurrence relation and initial terms, SumDecompose writes un as a sum of holonomic sequences of lower order when possible: un = u1n + u2n + ... where each uin is a holonomic sequence that can not be further decomposed as a sum of even lower order sequences. A holonomic sequence un has a non-trivial sum decomposition if and only if the minimal operator of un is an LCLM of lower order operators. SumDecompose computes an LCLM factorization of the minimal recurrence.

• 

If un satisfies a recurrence R that is an LCLM of lower order recurrences R1, R2 that have a non-trivial GCRD, then the sum decomposition un=u1n+u2n which writes un as a solution of R1 plus a solution of R2 is not unique because one can add any solution of the GCRD to u1n, and subtract the same from u2n. To express this non-uniqueness, parameters _Zi (i=1,2,...) will then appear in the optional output Values. Any choice for these parameters _Zi will give a correct sum decomposition.

• 

If un is a holonomic sequence, and if v is a list of sufficiently many initial terms of un, then GuessRecurrence computes a recurrence for un. Similar functionality is provided by gfun[`listtorec`], however, GuessRecurrence tries orders and degrees that are as high as possible for the number of specified terms (minus some terms set aside for checking). If a sequence is holonomic, and if sufficiently many terms are specified, then the output will be a correct recurrence. However, given only finitely many terms, it is not possible to prove that a sequence is holonomic, and if so, how many terms are needed to find the correct recurrence, hence the name GuessRecurrence.

• 

The optional argument offset is needed when the first element of v is not u0. For instance, if the sequence starts with u1, u2, ... then the offset is 1. The optional literal argument Minimize causes GuessRecurrence, if it finds a recurrence, to run a part of MinimalRecurrence. It skips steps that can be slow when the guessed recurrence is not correct, so if the guessed recurrence is correct, to check or prove that its order is minimal, call MinimalRecurrence.

Examples

withLREtools:

Run+2un+1n+n1un=0

Run+2un+1n+n1un=0

(1)

MinimalRecurrenceR,un,u0=1,u1=2

un+1un=0,Relation holds for,2n,Initial terms,u2=1

(2)

The Online Encyclopedia for Integer Sequences, oeis.org, gives this recurrence for sequence A000159:

R2252307n+1041077an+504614n23362985n+5118150an1+1280831n27397886n+6461565an2+746598n22913543n1336090an3+405481n2+6175011n15469320an4+375862n2+4098537n8846430an5+2187931n+560630an6=0

R2252307n+1041077an+504614n23362985n+5118150an1+1280831n27397886n+6461565an2+746598n22913543n1336090an3+405481n2+6175011n15469320an4+375862n2+4098537n8846430an5+2187931n+560630an6=0

(3)

Here are some initial values:

v2,8,20,152,994,7888,70152,695760

v2,8,20,152,994,7888,70152,695760

(4)

offset3

offset3

(5)

initseqai+offset=vi+1,i=0..nopsv1

inita3=2,a4=8,a5=20,a6=152,a7=994,a8=7888,a9=70152,a10=695760

(6)

When init contains more initial conditions than necessary, MinimalRecurrence uses R to check them, which helps to detect mistakes.

MinRecMinimalRecurrenceR,an,init

MinRecnn+2n12n12an+3n12n+1n+32n3n26n+6an+22n1n+3n+22n3+n26n6an+1n+3n+2n+12n+12an=0,Relation holds for,3n,Initial terms,a3=2,a4=8,a5=20

(7)

Assuming the input R is correct, the output MinRec will be the recurrence with proved minimal order. A closed form expression for a(n) can be computed as follows: MinRec has a second order right factor that can be solved in closed form, and the remaining solution coming from the left-factor can be rounded to a closed form expression.

If a sequence is holonomic, and if sufficiently many terms are given, then GuessRecurrence will find a recurrence. Here are the first 65 terms of sequence A001455:

v1,16,181,1821,17557,167449,1604098,15555398,153315999,1538907306,15743413076,164161815768,1744049683213,18865209953045,207591285198178,2321616416280982,26362085777156567,303635722412859447,3544040394934246209,41881891423602685193,500690223797206725847,6050434838705784406551,73852382382545858737126,909943177632220199263042,11310232116090782070465841,141740653186926189324638372,1790036582998939530743648877,22770455209205915603060025597,291634367197743500729356426685,3759180275300445999022196165965,48750519654702845837670090343690,635848553797809170295520418710782,8338432923207513905107942840897207,109913145478761588817424570169064291,1455916882814340050784910924367005361,19374962426023058076066772960412712729,258979624482677760588598118094798186615,3476327437847817541578871045524189487175,46851360725326736422851309373608573753486,633857940571765164166776008459212715340810,8607097892030531766959008406359887257969457,117286552938953817595159195919871584342485297,1603623007332069507772874752316422357340842762,21996762674368942915438738304929059321225086798,302664294908715565330818633036974690001530040351,4176922219912768041025272080018132501948775088287,57808845662644153479643363699008882629886528423638,802283219167808255381222688196525534650228123585138,11163800149167922644844439353688236270618650367355161,155741807964112273187678730231773629630772872894151753,2178047448779761494253016767936757887129550255760546007,30532382229662866143058035395061816620136483264523454767,428992304879718047693575798315682771874889192666983370217,6040874726749408043810961537174482718932561906717437996521,85247065836795137741519089655948480065911416135277934186122,1205473572310704760456166438628704554807892246934960123492974,17080691328825216538079811628828842602913045806045692424793199,242490618231277416363895463725311815053057447415805956401781074,3449051981599752494976878291288265335774407317286658116086140292,49146729874459740441919474443279449173330676418367247395292174104,701545004460344542554347244732973635473253721108063985623413774493,10031352489974488598965839409501869308563264624360941341155603315133,143676099686733622553027802165808514225442825885288070049291479402458,2061150250350872821775172625249417982149763747555391307060801829076558,29615206122264489924249122928926530951101815751524692956745132636470263

v1,16,181,1821,17557,167449,1604098,15555398,153315999,1538907306,15743413076,164161815768,1744049683213,18865209953045,207591285198178,2321616416280982,26362085777156567,303635722412859447,3544040394934246209,41881891423602685193,500690223797206725847,6050434838705784406551,73852382382545858737126,909943177632220199263042,11310232116090782070465841,141740653186926189324638372,1790036582998939530743648877,22770455209205915603060025597,291634367197743500729356426685,3759180275300445999022196165965,48750519654702845837670090343690,635848553797809170295520418710782,8338432923207513905107942840897207,109913145478761588817424570169064291,1455916882814340050784910924367005361,19374962426023058076066772960412712729,258979624482677760588598118094798186615,3476327437847817541578871045524189487175,46851360725326736422851309373608573753486,633857940571765164166776008459212715340810,8607097892030531766959008406359887257969457,117286552938953817595159195919871584342485297,1603623007332069507772874752316422357340842762,21996762674368942915438738304929059321225086798,302664294908715565330818633036974690001530040351,4176922219912768041025272080018132501948775088287,57808845662644153479643363699008882629886528423638,802283219167808255381222688196525534650228123585138,11163800149167922644844439353688236270618650367355161,155741807964112273187678730231773629630772872894151753,2178047448779761494253016767936757887129550255760546007,30532382229662866143058035395061816620136483264523454767,428992304879718047693575798315682771874889192666983370217,6040874726749408043810961537174482718932561906717437996521,85247065836795137741519089655948480065911416135277934186122,1205473572310704760456166438628704554807892246934960123492974,17080691328825216538079811628828842602913045806045692424793199,242490618231277416363895463725311815053057447415805956401781074,3449051981599752494976878291288265335774407317286658116086140292,49146729874459740441919474443279449173330676418367247395292174104,701545004460344542554347244732973635473253721108063985623413774493,10031352489974488598965839409501869308563264624360941341155603315133,143676099686733622553027802165808514225442825885288070049291479402458,2061150250350872821775172625249417982149763747555391307060801829076558,29615206122264489924249122928926530951101815751524692956745132636470263

(8)

The offset for this sequence is 4, which means that v = [u(4), u(5), ...] (If the optional argument offset is omitted, then GuessRecurrence assumes that it is 0 and interpret v as [u(0),u(1),...]).

offset4

offset4

(9)

RGuessRecurrencev,un,offset,Minimize

Rnn+8225n5+4320n4+31407n3+107518n2+173854n+108052n+72n+62un+46750n9+238500n8+3615975n7+30715368n6+160015744n5+525218164n4+1069898799n3+1267661576n2+739767140n+123127200n+62un+3+n+361425n10+2417085n9+41671026n8+413620650n7+2610729041n6+10910664473n5+30420114588n4+55433353504n3+62336195488n2+38044196976n+8981078400un+22n+392250n8+2863125n7+37459200n6+269470646n5+1163725924n4+3079221085n3+4843780850n2+4089668904n+1382141376n+22un+1+576n+3225n5+5445n4+50937n3+229909n2+501516n+425376n+12n+23un=0

(10)

Without the optional argument Minimize, the output in this example would have been larger.

initsequi+offset=vi+1,i=0..5

initu4=1,u5=16,u6=181,u7=1821,u8=17557,u9=167449

(11)

SSumDecomposeR,un,init,Values

Sun=u1n+u2n,n+42u1n+2+10n242n41u1n+1+9n+12u1n=0,n+6n+52u2n+2+20n3182n2510n428u2n+1+64n+2n+12u2n=0,Relation holds for,4n

(12)

seqValues1,i,i=offset..offset+10

−23,−103,−513,−2761,−15767,−94359,−586590,−3763290,−24792705,−167078577,−1148208090

(13)

seqValues2,i,i=offset..offset+10

24,119,694,4582,33324,261808,2190688,19318688,178108704,1705985883,16891621166

(14)

After looking up these last two sequences in oeis.org we discover that A001455(n) = A047889(n) - A005802(n)

ODEx16x1x116x325x2+14x1diffyx,x,x+512x51200x4+1289x3531x2+51x1diffyx,x+64x4132x3+131x260x+5yx=0

ODEx16x1x116x325x2+14x1ⅆ2ⅆx2yx+512x51200x4+1289x3531x2+51x1ⅆⅆxyx+64x4132x3+131x260x+5yx=0

(15)

SgfundiffeqtorecODE,y0=1,yx,un

S256n2+256n+64un+672n21872n1332un+1+665n2+3284n+4039un+2+279n21926n3327un+3+31n2+268n+581un+4+n210n25un+5,u0=1,u1=5,u2=55,u3=719,u4=10119

(16)

MinimalRecurrenceS

4n3+23n2+19n+4n+22un+217n2+34n+124n3+31n2+49n+18un+1+44n3+35n2+77n+502n+12un=0,Relation holds for,0n,Initial terms,u0=1,u1=5

(17)

In this last example, R, dvar, and init were not listed as separately in the input, but MinimalRecurrence (and SumDecompose) can deduce them when the set S has only one dependent variable, one recurrence relation, and all remaining elements are initial conditions.

References

  

M. van Hoeij. "Factoring Linear Recurrence Operators." URL www.math.fsu.edu/~hoeij/2019/slides.pdf

Compatibility

• 

The LREtools[MinimalRecurrence], LREtools[SumDecompose] and LREtools[GuessRecurrence] commands were introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

See Also

gfun[`diffeqtorec`]

gfun[`listtorec`]

LREtools

LREtools[GeneralizedExponents]

LREtools[LCLM]

LREtools[RightFactors]