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
MinimalRecurrence(R, dvar, init)
SumDecompose(R, dvar, init, Values)
GuessRecurrence(v, dvar, offset, Minimize)
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
A sequence u⁡0, u⁡1, u⁡2, ... 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 u⁡n, given by a recurrence relation and initial terms, SumDecompose writes u⁡n as a sum of holonomic sequences of lower order when possible: u⁡n = u1⁡n + u2⁡n + ... where each ui⁡n is a holonomic sequence that can not be further decomposed as a sum of even lower order sequences. A holonomic sequence u⁡n has a non-trivial sum decomposition if and only if the minimal operator of u⁡n is an LCLM of lower order operators. SumDecompose computes an LCLM factorization of the minimal recurrence.
If u⁡n satisfies a recurrence R that is an LCLM of lower order recurrences R1, R2 that have a non-trivial GCRD, then the sum decomposition u⁡n=u1⁡n+u2⁡n which writes u⁡n as a solution of R1 plus a solution of R2 is not unique because one can add any solution of the GCRD to u1⁡n, and subtract the same from u2⁡n. 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 u⁡n is a holonomic sequence, and if v is a list of sufficiently many initial terms of u⁡n, then GuessRecurrence computes a recurrence for u⁡n. 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 u⁡0. For instance, if the sequence starts with u⁡1, u⁡2, ... 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.
with⁡LREtools:
R≔u⁡n+2−u⁡n+1⁢n+n−1⁢u⁡n=0
MinimalRecurrence⁡R,u⁡n,u⁡0=1,u⁡1=2
u⁡n+1−u⁡n=0,Relation holds for,2≤n,Initial terms,u⁡2=1
The Online Encyclopedia for Integer Sequences, oeis.org, gives this recurrence for sequence A000159:
R≔2⁢−252307⁢n+1041077⁢a⁡n+504614⁢n2−3362985⁢n+5118150⁢a⁡n−1+1280831⁢n2−7397886⁢n+6461565⁢a⁡n−2+746598⁢n2−2913543⁢n−1336090⁢a⁡n−3+−405481⁢n2+6175011⁢n−15469320⁢a⁡n−4+−375862⁢n2+4098537⁢n−8846430⁢a⁡n−5+2⁢−187931⁢n+560630⁢a⁡n−6=0
Here are some initial values:
v≔2,8,20,152,994,7888,70152,695760
offset≔3
init≔seq⁡a⁡i+offset=vi+1,i=0..nops⁡v−1
init≔a⁡3=2,a⁡4=8,a⁡5=20,a⁡6=152,a⁡7=994,a⁡8=7888,a⁡9=70152,a⁡10=695760
When init contains more initial conditions than necessary, MinimalRecurrence uses R to check them, which helps to detect mistakes.
MinRec≔MinimalRecurrence⁡R,a⁡n,init
MinRec≔n⁢n+2⁢n−1⁢2⁢n−12⁢a⁡n+3−n−1⁢2⁢n+1⁢n+3⁢2⁢n3−n2−6⁢n+6⁢a⁡n+2−2⁢n−1⁢n+3⁢n+2⁢2⁢n3+n2−6⁢n−6⁢a⁡n+1−n+3⁢n+2⁢n+1⁢2⁢n+12⁢a⁡n=0,Relation holds for,3≤n,Initial terms,a⁡3=2,a⁡4=8,a⁡5=20
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:
v≔1,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
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),...]).
offset≔4
R≔GuessRecurrence⁡v,u⁡n,offset,Minimize
R≔n⁢n+8⁢225⁢n5+4320⁢n4+31407⁢n3+107518⁢n2+173854⁢n+108052⁢n+72⁢n+62⁢u⁡n+4−6750⁢n9+238500⁢n8+3615975⁢n7+30715368⁢n6+160015744⁢n5+525218164⁢n4+1069898799⁢n3+1267661576⁢n2+739767140⁢n+123127200⁢n+62⁢u⁡n+3+n+3⁢61425⁢n10+2417085⁢n9+41671026⁢n8+413620650⁢n7+2610729041⁢n6+10910664473⁢n5+30420114588⁢n4+55433353504⁢n3+62336195488⁢n2+38044196976⁢n+8981078400⁢u⁡n+2−2⁢n+3⁢92250⁢n8+2863125⁢n7+37459200⁢n6+269470646⁢n5+1163725924⁢n4+3079221085⁢n3+4843780850⁢n2+4089668904⁢n+1382141376⁢n+22⁢u⁡n+1+576⁢n+3⁢225⁢n5+5445⁢n4+50937⁢n3+229909⁢n2+501516⁢n+425376⁢n+12⁢n+23⁢u⁡n=0
Without the optional argument Minimize, the output in this example would have been larger.
init≔seq⁡u⁡i+offset=vi+1,i=0..5
init≔u⁡4=1,u⁡5=16,u⁡6=181,u⁡7=1821,u⁡8=17557,u⁡9=167449
S≔SumDecompose⁡R,u⁡n,init,Values
S≔u⁡n=u1⁡n+u2⁡n,n+42⁢u1⁡n+2+−10⁢n2−42⁢n−41⁢u1⁡n+1+9⁢n+12⁢u1⁡n=0,n+6⁢n+52⁢u2⁡n+2+−20⁢n3−182⁢n2−510⁢n−428⁢u2⁡n+1+64⁢n+2⁢n+12⁢u2⁡n=0,Relation holds for,4≤n
seq⁡Values⁡1,i,i=offset..offset+10
−23,−103,−513,−2761,−15767,−94359,−586590,−3763290,−24792705,−167078577,−1148208090
seq⁡Values⁡2,i,i=offset..offset+10
24,119,694,4582,33324,261808,2190688,19318688,178108704,1705985883,16891621166
After looking up these last two sequences in oeis.org we discover that A001455(n) = A047889(n) - A005802(n)
ODE≔x⁢16⁢x−1⁢x−1⁢16⁢x3−25⁢x2+14⁢x−1⁢diff⁡y⁡x,x,x+512⁢x5−1200⁢x4+1289⁢x3−531⁢x2+51⁢x−1⁢diff⁡y⁡x,x+64⁢x4−132⁢x3+131⁢x2−60⁢x+5⁢y⁡x=0
ODE≔x⁢16⁢x−1⁢x−1⁢16⁢x3−25⁢x2+14⁢x−1⁢ⅆ2ⅆx2y⁡x+512⁢x5−1200⁢x4+1289⁢x3−531⁢x2+51⁢x−1⁢ⅆⅆxy⁡x+64⁢x4−132⁢x3+131⁢x2−60⁢x+5⁢y⁡x=0
S≔gfundiffeqtorec⁡ODE,y⁡0=1,y⁡x,u⁡n
S≔256⁢n2+256⁢n+64⁢u⁡n+−672⁢n2−1872⁢n−1332⁢u⁡n+1+665⁢n2+3284⁢n+4039⁢u⁡n+2+−279⁢n2−1926⁢n−3327⁢u⁡n+3+31⁢n2+268⁢n+581⁢u⁡n+4+−n2−10⁢n−25⁢u⁡n+5,u⁡0=1,u⁡1=5,u⁡2=55,u⁡3=719,u⁡4=10119
MinimalRecurrence⁡S
4⁢n3+23⁢n2+19⁢n+4⁢n+22⁢u⁡n+2−17⁢n2+34⁢n+12⁢4⁢n3+31⁢n2+49⁢n+18⁢u⁡n+1+4⁢4⁢n3+35⁢n2+77⁢n+50⁢2⁢n+12⁢u⁡n=0,Relation holds for,0≤n,Initial terms,u⁡0=1,u⁡1=5
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.
M. van Hoeij. "Factoring Linear Recurrence Operators." URL www.math.fsu.edu/~hoeij/2019/slides.pdf
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[GeneralizedExponents]
LREtools[LCLM]
LREtools[RightFactors]
Download Help Document