3 (load(zeilberger),done);
7 /* New regression tests are at end */
9 /*=================================================================*/
10 /* converted from testZeilberger.mac (mvdb) */
14 /* ------------------------------ */
15 /* Gosper's algorithm's Test File */
18 g1:(-1)^k*k/(4*k^2-1);
20 zb_prove(g1,k,n,parGosper(g1,k,n,0));
25 zb_prove(g2,k,n,parGosper(g2,k,n,0));
30 zb_prove(g3,k,n,parGosper(g3,k,n,0));
33 g4:(-1)^k*a!/(k!*(a-k)!);
34 (-1)^k*a!/(k!*(a-k)!)$
35 zb_prove(g4,k,n,parGosper(g4,k,n,0));
40 zb_prove(g5,k,n,parGosper(g5,k,n,0));
45 zb_prove(g6,k,n,parGosper(g6,k,n,0));
49 /* --------------------------------- */
50 /* Zeiberger's Algorithm's Test File */
55 zb_prove(f1,k,n,parGosper(f1,k,n,1));
60 zb_prove(f2,k,n,parGosper(f2,k,n,1));
65 zb_prove(f3,k,n,parGosper(f3,k,n,2));
70 zb_prove(f4,k,n,parGosper(f4,k,n,2));
73 /* Binomial theorem */
74 h1: binomial(n,k)*x^k;
76 zb_prove(h1,k,n,parGosper(h1,k,n,1));
79 /* Vandermonde identity recurrence */
80 h2: binomial(a, k)* binomial(b, n-k);
81 binomial(a, k)* binomial(b, n-k);
82 zb_prove(h2,k,n,parGosper(h2,k,n,1));
85 /* Fibonacci-Recurrence */
86 h8: (-k+n)! / k! / (-2*k+n)!;
87 (-k+n)! / k! / (-2*k+n)!$
88 zb_prove(h8,k,n,parGosper(h8,k,n,2));
91 /* Trinomial coefficients */
92 h9: n! / k! / (k+m)! / (-2*k-m+n)!;
93 n! / k! / (k+m)! / (-2*k-m+n)!$
94 zb_prove(h9,k,n,parGosper(h9,k,n,2));
97 /* First special case of Strehl identity (MEMO, Feb 25, 1992) */
98 h10: binomial(n, k)^2 * binomial( 2*k, k);
99 binomial(n, k)^2 * binomial( 2*k, k)$
100 zb_prove(h10,k,n,parGosper(h10,k,n,2));
103 /* Fibonacci recurrence */
104 h13: (n+k)! * n! / k!^3 / (n-k)!^2;
105 (n+k)! * n! / k!^3 / (n-k)!^2$
106 zb_prove(h13,k,n,parGosper(h13,k,n,2));
109 /* Debugging artificial examples */
110 d1 : (2*n+k-1)!/(4*n+2*k)!;
111 (2*n+k-1)!/(4*n+2*k)!$
112 zb_prove(d1,k,n,parGosper(d1,k,n,1));
115 d2 : (3*n+k-1)!/(6*n+2*k)!;
116 (3*n+k-1)!/(6*n+2*k)!$
117 zb_prove(d2,k,n,parGosper(d2,k,n,1));
121 /* Dixon's identity */
122 h3: binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k;
123 binomial(n+b, n+k)* binomial(n+c, c+k)*binomial(b+c, b+k)*(-1)^k$
124 zb_prove(h3,k,n,parGosper(h3,k,n,1));
127 /* Karlsson-Gosper identity 1 */
128 h4: binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k);
129 binomial(n,k)*(n-1/4)!/(n-k-1/4)!/(2*n+k + 1/4)!*9^(-k)$
130 zb_prove(h4,k,n,parGosper(h4,k,n,1));
133 /* Karlsson-Gosper identity 2 */
134 h5: binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k);
135 binomial(n,k) * (n-1/4)! / (n-k-1/4)! / (2*n+k+5/4)! * 9^(-k)$
136 zb_prove(h5,k,n,parGosper(h5,k,n,1));
139 /* Laguerre-Orthogonality */
140 h7: (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! /
141 (k)! / (k2)! * (-1)^k;
142 (k+k2)! * (n1)! * (n2)! / (k)! / (n1-k)! / (k2)! / (n2-k2)! /
143 (k)! / (k2)! * (-1)^k$
144 zb_prove(h7,k,n1,parGosper(h7,k,n1,1));
147 /* Second special case of Strehl identity (MEMO, Feb 25, 1992) */
148 h11: binomial(n, k)^2 * binomial( 2*k, k+a);
149 binomial(n, k)^2 * binomial( 2*k, k+a)$
150 zb_prove(h11,k,n,parGosper(h11,k,n,3));
154 /* See rtest_zeilberger_extreme.mac */
157 /* End of converted file */
158 /* ================================================== */
161 /* test for unary minus, currently failing, fixed by Andrej */
162 ratsimp(AntiDifference(-1/(k*(k+1)),k));
165 /* suggested by Andrej */
166 AntiDifference(2^(k^2), k);
169 AntiDifference(k^k, k);
172 Zeilberger(binomial(n,i), i, n);
173 [[i/(n-i+1), [2, -1]]]$
174 zb_prove(binomial(n,i),i,n,%);