MVR4
I;help/GUESS/text/GuessRatio-%%TEXTG6D%"~G%boFUNCTION:~GuessRatio~-~rational~in
terpolation~for~a~sequence~of~numbersGF&%2CALLING~SEQUENCE:G%0~~GuessRatio(l)G%
7~~GUESS[GuessRatio](l)GF&%,PARAMETERS:G%F~~l~~~~~~~~~~~~~~~-~a~list~of~numbers
GF&%*SYNOPSIS:G%co-~The~~return~~value~~of~~GuessRatio(l)~~~is~~a~rational~func
tion~in~theG%2~~variable~_i[0].GF&%co-~Whenever~there~is~a~conflict~between~the
~function~name~~GuessRatio~andG%co~~another~~name~~used~~~in~~~the~~~same~~sess
ion,~~~use~~the~~long~~formG%7~~GUESS['GuessRatio'].GF&%*EXAMPLES:G%/>~with(GUE
SS):G%A>~l~:=~[seq((i^2+1)/i,i=1..10)];GF&%`o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~101G%ao~~~~~~~~~~l~:=~[2,~5/2,~10/3,~17/4,~26/5
,~37/6,~50/7,~65/8,~82/9,~---]G%`o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~10GF&%3>~GuessRatio(~l~);GF&%N~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~2G%M~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1~+~_i[0]G%O~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~|fr----------|hrG%L~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~_i[0]GF&%CSEE~ALSO:~GUESS,~Guess,~GuessPoly,G6",
I0GUESS/GuessCons:6$%"lG%"tG6(%"iG%"kG%%funcG%$resG%#riG%"xGF?F?C&?(8$"""FO-%%n
opsG6#9$%%trueG>-8&6#FN-%#opG6$FNFS>8'7"?(FN""!FO,&FPFO!"#FOFTC$>8(-%<GUESS/Rat
ionalInterpolationG6'FW8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P?(FNFOFOF_oFT>-Fj
oFXFY>Fgn-Fao6'FjoFW,&F_oFOF\oFOFjn7#-Fho6$FN/FN;FO,&F_oFOFeoFO@$/FgnF`p-F\\l6#
F`p@%/-Fep6#,&-Fhp6$/FWF_oFgnFO-FjoF]qFeoFjn-Fhp6$/FW&Fby6#FjnFgnF`pF?F?F?,
I+GUESS/init:F?F?F?F?C%-%*interfaceG6#/%,verboseprocGFjn-%%withG6$%'linalgG%)li
nsolveG-F]_l6#/F`_lFOF?F?F?,
I6help/GUESS/text/Guess-F$6gnF&%UFUNCTION:~Guess~-~products~of~rational~interpo
lationG%L~~~~~~~~~~~~~~~~-~for~a~sequence~of~numbersGF&F(%5~~Guess(l,<options>)
G%<~~GUESS[Guess](l,<options>)GF&F+F,%ao~~level~~~~~~~~~~~-~an~integer~(optiona
l,~as~to~be~in~second~position)G%P~~'one'~~~~~~~~~~~-~the~string~'one'~(optiona
l)G%T~~'nogamma'~~~~~~~-~the~string~'nogamma'~(optional)GF&F-%eo-~Guess(l)~trie
s~to~find~a~closed~form~for~a~sequence~within~the~hierarchyG%eo~~of~expressions
~~of~~the~~form~~<rational~function>,~<product~of~rationalG%gn~~function>,~<pro
duct~of~product~of~rational~function>,~etc.GF&%eo-~Guess(l,level)~~does~the~sam
e~thing~~as~~Guess(l)~~but~~it~searches~onlyG%B~~within~the~first~'level'~level
sGF&%eo-~Guess(l,'one')~~does~the~same~thing~as~Guess(l)~but~it~returns~the~fir
stG%5~~solution~it~finds.GF&%eo-~Guess(l,'nogamma')~~~does~~the~~same~~thing~as
~~Guess(l)~~but~it~returnsG%G~~expressions~without~GAMMA~functions.GF&%eo-~When
ever~there~is~a~conflict~between~the~function~name~Guess~and~anotherG%]o~~name~
used~in~the~same~session,~use~the~long~form~GUESS['Guess'].GF&F3F4%^o>~l~:=~[se
q(product(product(GAMMA(i)*i^2,i=1..j),j=1..k),k=1..10)]:GF&%1>~Guess(~l,~1~);G
%J~~~~~~~~~~~~~~~~~~~~~~~~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r~~~|gr~~|gr~~~~~~~~~~~~~~~~~~~~~~~~|gr|grG%do~~~~~~~~~_i[1]~=~1~~~~\
\_i[2]~=~1~~~~~\\_i[3]~=~1~~~~~~~~~~~~~~~~~~~~~~//GF&%HSEE~ALSO:~GUESS,~GuessPo
ly,~GuessRatio,GF?,
I<GUESS/RationalInterpolation:6'%"fGFK%"mGFG%&xlistG6(FF%#xxG%#fxG%$matG%(tempv
ecG%&mymaxGF?F?C/>Fjo9(>FW-Fir6$FSFjo>Fgn7#-Fho6$FO/FN;FO,(9&FO9'FOF]wFO>F_o7#-
Fho6$FO/FN;FO,(F[dlFOF\dlFOFOFO>Fgn-%'subsopG6$/FOF_oFgn>Fgn-Ffdl6$/,&F[dlFOF]w
FO-FerFjtFgn>Fco-%$maxG6$F[dlF\dl?(FNFOFOFcoFTC%>F_o-%/GUESS/ListProdG6$F_oFjo@
$1FNF[dl>Fgn-Ffdl6$/FfxF_oFgn@$1FNF\dl>Fgn-Ffdl6$/,(FNFOF[dlFOF]wFO-Fer6#-Fgel6
$F_oFWFgn>Fjo-Fe_l6$-%*transposeG6#-F]uF]r-%'vectorG6#7#-Fho6$FjnFadl@$/FjoF`pF
i]l>Fjo-F_r6$FjoFdr>Fjo-Ffdl6$/FO-Fhp6$/-FbglFh^lFjn-FZ6$FOFjoFjo-%'normalG6#*&
,&FdhlFO-%$sumG6$.*&-FZ6$FfxFjoFO)F[rFNFO/.FN;FOF[dlFOFO-F\il6$.*&-FZ6$FNFjoFO)
F[r,(FNFOF[dlFeoF\oFOFO/Fdil;F]elFjclFeoF?F?F?,
I/GUESS/ListProd:6$%#l1G%#l2G6#FFF?F?7#-Fho6$*&FYFO-FZ6$FNF[rFO/FN;FOFPF?F?F?,
I6help/GUESS/text/GUESS-F$6LF&%^oHELP~FOR:~A~package~to~guess~closed~form~for~a
~sequence~of~numbers.GF&F(%:~~GUESS[<function>](args)G%3~~<function>(args)GF&F-
%eo-~This~~package~~provides~~functions~~to~find~a~closed~form~for~a~sequenceG%
eo~~of~~numbers~~~within~~the~~hierarchy~~of~~~expressions~~~of~~~the~~~formG%e
o~~<rational~function>,~<product~of~rational~function>,~<product~of~productG%>~
~of~rational~function>,~etc.GF&%fo-~Whenever~there~is~a~conflict~between~a~func
tion~name~in~GUESS~and~anotherG%`o~~name~used~in~the~same~session,~use~the~long
~form~GUESS[<function>].GF&%?-~The~available~functions~are:GF&%T~~~~~Guess~~~~~
~~~~~~~~GuessPoly~~~~~~~~~GuessRatioGF&%eo-~For~help~with~a~particular~function
,~type~either~~?GUESS[<function>]~~orG%eo~~?GUESS,<function>~~where~<function>~
~is~~~one~~~from~~~the~~above~~list.GF&F3F4F&%4>~Guess(~[1,2,3]~);GF&%L~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~|fr_i[0]|hrGF&%P>~Guess(~[1,2,7,42,429,7436,218348,
10850216]~);GF&%+~_i[0]~-~1G%io~~--------'~~~~~~~~~_i[1]~~~_i[1]~2~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~1/2G%fo~'~~|gr~~|gr~~~~~~~(3/4)~~~~~~(3~~~~~)~~GAMMA
(_i[1]~+~4/3)~GAMMA(_i[1]~+~2/3)~3G%io|fr~~~|gr~~|gr~~~3/4~--------------------
-------------------------------------------G%A~~~~|gr~~|gr~~~~~~~~~~~~~~~~~_i[1
]~2G%ao~~~~|gr~~|gr~~~~~~~~~~~~~~~(2~~~~~)~~GAMMA(_i[1]~+~3/2)~GAMMA(_i[1]~+~1/
2)G%+~_i[1]~=~1GF&%&~~~~|hrGF&F?,
I:help/GUESS/text/GuessPoly-F$6?F&%coFUNCTION:~GuessPoly~-~polynomial~interpola
tion~for~a~sequence~of~numbersGF&F(%/~~GuessPoly(l)G%6~~GUESS[GuessPoly](l)GF&F
+F,F&F-%do-~The~return~value~of~GuessPoly(l)~is~a~polynomial~in~the~variable~_i
[0].GF&%co-~Whenever~there~is~a~conflict~between~the~function~~name~~GuessPoly~
andGF1%6~~GUESS['GuessPoly'].GF&F3F4%;>~GuessPoly(~[1,4,9,16]~);GF&%L~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2G%K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_i[0]G
F&%;>~GuessPoly(~[1,3,6,10]~);GF&%S~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1/2~_i[0]~(1~+~
_i[0])GF&%DSEE~ALSO:~GUESS,~Guess,~GuessRatio,GF?
