In[]:=
<<RISC`HolonomicFunctions`
HolonomicFunctions Package version 1.7.3 (21-Mar-2017)
written by Christoph Koutschan
Copyright Research Institute for Symbolic Computation (RISC),
Johannes Kepler University, Linz, Austria
--> Type ?HolonomicFunctions for help.
(*Recurrencesforthesummand*)​​Annihilator[Binomial[n-1,n-i]Binomial[k+i,i]Binomial[n-1,n-k],{S[i],S[k],S[n]}]
Out[]=
{(1-i-k+ik+2n-in-kn+
2
n
)
S
n
-
2
n
,(k+
2
k
)
S
k
+(k+ik+
2
k
-n-in-kn),(i+
2
i
)
S
i
+(i+
2
i
+ik-n-in-kn)}
(*Sumw.r.t.k,wehavenaturalboundaries.*)​​CreativeTelescoping[%,S[k]-1][[1]]
Out[]=
(2in+2
2
i
n)
S
i
+(i-
2
i
-n+3in-
2
i
n-2
2
n
+2i
2
n
-
3
n
)
S
n
+(in+
2
i
n-
2
n
-2i
2
n
+
3
n
),(4-6i+2
2
i
+8n-7in+
2
i
n+5
2
n
-2i
2
n
+
3
n
)
2
S
n
+(-4+3i+
2
i
-11n+5in+
2
i
n-10
2
n
+2i
2
n
-3
3
n
)
S
n
+(2
2
n
+2
3
n
)
(*Sumw.r.t.i,weagainhavenaturalboundaries.*)​​lhs=CreativeTelescoping[%,S[i]-1][[1,1]]
Out[]=
(2+n)
2
S
n
+(-14-10n)
S
n
+9n
In[]:=
(*Sanitycheck*)​​test=ApplyOreOperator[lhs,f[n]]​​Table[test,{n,0,10}]/.f[n_]Sum[Binomial[n-1,n-i]Sum[Binomial[k+i,i]Binomial[n-1,n-k],{k,0,n}],{i,0,n}]
Out[]=
9nf[n]+(-14-10n)f[1+n]+(2+n)f[2+n]
Out[]=
{0,0,0,0,0,0,0,0,0,0,0}
(*Computingarecurrenceforrhsnaively.Overshoots.*)​​rhs=Annihilator[(-1)^n*((-4*n^2-16*n-28)*JacobiP[-1+n,-1-2*n,2,-1/2]+JacobiP[-2+n,-2*n,3,-1/2]*(3+n)*(-1+n))*4^n/(48*(1+n)*n),S[n]][[1]]
Out[]=
(-1562400-4868160n-6150626
2
n
-3935493
3
n
-1208229
4
n
-26582
5
n
+109502
6
n
+38698
7
n
+6316
8
n
+517
9
n
+17
10
n
)
4
S
n
+(23909760+73450104n+92784014
2
n
+60420290
3
n
+19454164
4
n
+847050
5
n
-1680498
6
n
-647214
7
n
-112940
8
n
-9830
9
n
-340
10
n
)
3
S
n
+(-92065680-284389056n-366936588
2
n
-248973260
3
n
-86338780
4
n
-6087004
5
n
+7168996
6
n
+3106472
7
n
+589066
8
n
+54988
9
n
+2006
10
n
)
2
S
n
+(31888080+128030760n+209974590
2
n
+177364170
3
n
+75851640
4
n
+8072478
5
n
-7251858
6
n
-3712806
7
n
-784080
8
n
-79290
9
n
-3060
10
n
)
S
n
+(-7918398
2
n
-18526563
3
n
-14472027
4
n
-3048030
5
n
+1779570
6
n
+1233954
7
n
+302454
8
n
+33615
9
n
+1377
10
n
)
(*Theoperatorforrhsisaleft-multipleoflhs.*)​​OreReduce[rhs,{lhs}]
Out[]=
0
In[]:=
(*Smarterwayofcomputingrecurrenceforrhs,usinggeneralJacobiP.*)​​annJ=Annihilator[JacobiP[n-2,a,b,-1/2],{S[n],S[a],S[b]}]
Out[]=
3
S
a
+
S
b
-4,(-4+4n)
S
n
+(2-a-b-2n)
S
b
+(-4+4b+4n),(a+b+n)
2
S
b
+(-2-a-5b-2n)
S
b
+(-4+4b+4n)
In[]:=
DFiniteSubstitute[DFiniteOreAction[annJ,(-1+n)(3+n)*S[a]*S[b]+(-4*n^2-16*n-28)**S[n]],{a-2n-1,b2}]
Out[]=
(32+48n+16
2
n
)
2
S
n
+(168+176n+40
2
n
)
S
n
+(54+45n+9
2
n
)
In[]:=
rhs=DFiniteTimes[%,Annihilator[(-1)^n*4^n/(48*(1+n)*n),S[n]]][[1]]
Out[]=
(2+n)
2
S
n
+(-14-10n)
S
n
+9n
(*Bothsidessatisfythesamesecond-orderrecurrence.Hence:checktwoinitialvalues.*)​​lhsrhs
Out[]=
True