parGosper from zeilberger package doesn't work as expected
Subject: parGosper from zeilberger package doesn't work as expected
From: Andrej Vodopivec
Date: Tue, 16 Aug 2011 11:23:39 +0200
Maybe the documentation could be improved.
parGosper(F(n,k), k, n, d) returns a recurrence for F(n,k) such that
sum( a_i F(n+i,k), i, 0, d) = R(n,k+1)*F(n,k+1) - F(n, k)*F(n, k).
In your example:
(%i2) F(d,a1,k1,a2,k2,b2,l2)
:= 1/(a1-k1)!/k1!*(-1)^k1
/(a2-k2)!/k2!*(-1)^k2
/(b2-l2)!/l2!*(-1)^l2
*(a1+2*a2+k1+d-1)!
/(a1+2*a2+k1+d)!
*(a1+a2+k1+k2+d-1)!
/(k2+d-2)!
*(b2+l2+d-2)!/(l2+d-2)!
*(k2+l2+d-2)!/(k2+l2+d-1+k1)!$
(%i3) h: parGosper(F(d,a1,k1,a2,k2,b2,l2),b2,l2,0)$
(%i4) define(R(d,a1,k1,a2,k2,b2,l2), h[1][1])$
define(A0(d,a1,k1,a2,k2,b2,l2), h[1][2][1])$
(%i6) res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2)
- (R(d,a1,k1,a2,k2,b2+1,l2)*F(d,a1,k1,a2,k2,b2+1,l2)
- R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2))$
(%i7) factor(minfactorial(%));
(%o7) 0
BTW, if the degree of the recurrence is 0 then the term is Gosper
summable, so you can also use AndiDifference:
(%i8) ADF: AntiDifference(F(d,a1,k1,a2,k2,b2,l2), b2)$
(%i9) ADF - R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2);
(%o9) 0
HTH, Andrej
-----------------------
http://gplus.to/andrejv
2011/8/14 andre maute <andre.maute at gmx.de>:
> Hi,
>
> I have the following test for parGosper,which seems not to work.
> I think i have interpreted the documentation correctly.
>
> res below should vanish identically.
> I have attached my maxima file and an output file.
>
> Andre
>
> ---- testparGosper.max ----
> display2d : false;
>
> load(zeilberger);
>
> F(d,a1,k1,a2,k2,b2,l2)
> ? ?:= 1/(a1-k1)!/k1!*(-1)^k1
> ? ? ? ?/(a2-k2)!/k2!*(-1)^k2
> ? ? ? ?/(b2-l2)!/l2!*(-1)^l2
> ? ? ? ?*(a1+2*a2+k1+d-1)!
> ? ? ? ?/(a1+2*a2+k1+d)!
> ? ? ? ?*(a1+a2+k1+k2+d-1)!
> ? ? ? ?/(k2+d-2)!
> ? ? ? ?*(b2+l2+d-2)!/(l2+d-2)!
> ? ? ? ?*(k2+l2+d-2)!/(k2+l2+d-1+k1)!;
>
> h : parGosper(F(d,a1,k1,a2,k2,b2,l2),b2,l2,0);
>
> R(d,a1,k1,a2,k2,b2,l2) := h[1][1];
> A0(d,a1,k1,a2,k2,b2,l2) := h[1][2][1];
>
> res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2)
> ? ?- (R(d,a1,k1,a2,k2,b2,l2+1)*F(d,a1,k1,a2,k2,b2,l2+1) -
> R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2));
> res : factor(minfactorial(res));
>
> ---------------------------
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>