###################################################################### ## AperyLimits Save this file as AperyLimits.txt to use it, # # stay in the # ## same directory, get into Maple (by typing: maple ) # ## and then type: read `AperyLimits.txt` # ## Then follow the instructions given there # ## # ## Written by Doron Zeilberger, Rutgers University , # ## DoronZeil at gmail dot com # ###################################################################### print(`First Written: April 2021: tested for Maple 2018 `): print(`Version : April 2021: `): print(): print(`This is AperyLimit.txt, A Maple package`): print(`accompanying Robert Dougherty-Bliss and Doron Zeilberger's article: `): print(`" Experimenting with Apery Limits and WZ pairs" `): print(): print(`The most current version is available on WWW at:`): print(` http://sites.math.rutgers.edu/~zeilberg/tokhniot/AperyLimits.txt .`): print(`Please report all bugs to: DoronZeil at gmail dot com .`): print(`---------------------------`): print(): print(`For general help, and a list of the MAIN functions,`): print(` type "ezra();". For specific help type "ezra(procedure_name);" `): print(`---------------------------`): print(`For a list of the supporting functions type: ezra1();`): print(` For specific help type "ezra(procedure_name);" `): print(): print(`---------------------------`): print(`---------------------------`): print(`For a list of the STORY functions type: ezraS();`): print(` For specific help type "ezra(procedure_name);" `): print(): print(`---------------------------`): print(`For a list of the Pre-computed functions type: ezraPC();`): print(` For specific help type "ezra(procedure_name);" `): print(): print(`---------------------------`): print(`For help with EKHAD procedures type: ezraEKHAD();`): print(): ezra1:=proc() if args=NULL then print(`The SUPPORTING procedures are`): print(` MyIDs, MyIDsLog, OperAZd, OperZeil, SeqFromRec, GEk, guessGEk, guessPol`): else ezra(args): fi: end: ezraS:=proc() if args=NULL then print(`The STORY procedures are`): print(`CubicStory, DELazSipur, DELazV, DELazGv, DELsipur1, DELsipur2, DELsipur3, DELv, QuadStory `): else ezra(args): fi: end: ezraPC:=proc() if args=NULL then print(`The Pre-computed procedures are`): print(` OutAZ1, OutF1 `): else ezra(args): fi: end: ezra:=proc() if args=NULL then print(`The MAIN procedures are:`): print(` DEL, DELaz, DELazG, DELmaz, FindAZ1, FindAZ2, FindMAZ, FindZ1, FindZ2, OpeMAZ1, RAT, RATaz `): elif nargs=1 and args[1]=CubicStory then print(`CubicStory(c): An article about conjectured fast approximations to the root of 64+144*x*(1+2*c)+108*x^2*(3*c^2+3*c+1)+27*x^3*(1+2*c)=0. Try:`): print(`CubicStory(c):`): elif nargs=1 and args[1]=DEL then print(`DEL(F,k,n,K): inputs a closed-form expression and outputs the sequence a(n)/b(n) where`): print(`b(n):=Sum(F,k=0..n) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1, `): print(`It also returns the deltas. Try:`): print(`DEL(binomial(n,k)*binomial(n+k,k)*binomial(n+2*k,k),k,n,1000);`): print(`DEL(binomial(n,k)*binomial(n+k,k)*binomial(n+2*k,k)*a^k,k,n,1000);, for a=2,3,4,`): print(`DEL(binomial(n,k)*binomial(n+2*k,k)*a^k,k,n,1000);, for a=3,4,`): print(` DEL(binomial(n,k)*binomial(2*n+2*k,2*k)*3^k,k,n,1000);`): print(`DEL(binomial(n-k,2*k)*a^(n-k),k,n,1000);, a=1,2,3,...`): print(`DEL(binomial(n,k)*binomial(n+k,k)^2*a^k,k,n,1000);, a=1,2,3,...`): print(` DEL(binomial(n,k)^2*binomial(n+2*k,2*k)*a^k,k,n,1000);, a=1,2,3,4,...`): print(` DEL(binomial(n,k)^3*binomial(n+k,k)^2*a^k,k,n,1000);, a=1,2,3...`): elif nargs=1 and args[1]=DELaz then print(`DELaz(P,x,K): inputs a Laurent polynoimal P in the cont. variable x and the discrete variable n`): print(`and outputs a(K)/b(K) where`): print(`b(n):=CT(P^n,x) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1`): print(`It also gives you the estimated delta. try:`): print(`DELaz(1/x+1+x,x,1000);`): print(`a:=1;DELaz((x+1)*((a+1)*x+a)/x,x,1000);identify(%[1]); and for larger a, getting (conjecturally) arctanh(1/(2*a+1))`): elif nargs=1 and args[1]=DELazSipur then print(`DELazSipur(x,K): outputs an article with the DELazV(P,x,K) for P in OutAZ1(x), giving positive deltas. Try:`): print(`DELazSipur(x,1000):`): elif nargs=1 and args[1]=DELazV then print(`DELazV(P,x,K): a verbose form of DELaz(P,x,K) (q.v.), try:`): print(`DELazV(1/x+1+x,x,1000);`): print(`a:=1;DELazV((x+1)*((a+1)*x+a)/x,x,1000);identify(%[1]); and for larger a, getting (conjecturally) arctanh(1/(2*a+1))`): elif nargs=1 and args[1]=DELsipur1 then print(`DELsipur1(A,B,k,n,K): outputs an article for DEL(F,k,n,K) for all F of the form binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k, for 1<=a1,a2<=A, 0<=b1,b2<=A, 1<=x<=B, try:`): print(`DELsipur1(1,1,k,n,1000):`): elif nargs=1 and args[1]=DELsipur2 then print(`DELsipur2(A,B,k,n,K): outputs an article for DEL(F,k,n,K) for all F of the form binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*binomial(a3*n+b3*k,k)x^k, for 1<=a1,a2,a3<=A, 0<=b1,b2,b3<=A, 1<=x<=B, try:`): print(`DELsipur2(1,1,k,n,1000):`): elif nargs=1 and args[1]=DELsipur3 then print(`DELsipur3(n,k,K): outputs an article for DEL(F,k,n,K) for all F in the pre-computed OutF1(n,k). Try:`): print(`DELsipur3(n,k,K)`): elif nargs=1 and args[1]=DELv then print(`DELv(F,k,n,K): a verbose version of DEL(F,k,n,K) (q.v.). Try: `): print(``): print(`DELv(binomial(n,k)*binomial(n+k,k)*binomial(n+2*k,k),k,n,1000):`): print(`DELv(binomial(n,k)*binomial(n+k,k)*binomial(n+2*k,k)*a^k,k,n,1000):, for a=2,3,4,`): print(`DELv(binomial(n,k)*binomial(n+2*k,k)*a^k,k,n,1000):, for a=3,4,`): print(` DELv(binomial(n,k)*binomial(2*n+2*k,2*k)*3^k,k,n,1000):`): print(`DELv(binomial(n-k,2*k)*a^(n-k),k,n,1000):, a=1,2,3,...`): print(`DELv(binomial(n,k)*binomial(n+k,k)^2*a^k,k,n,1000):, a=1,2,3,...`): print(` DELv(binomial(n,k)^2*binomial(n+2*k,2*k)*a^k,k,n,1000):, a=1,2,3,4,...`): print(` DELv(binomial(n,k)^3*binomial(n+k,k)^2*a^k,k,n,1000):, a=1,2,3...`): elif nargs=1 and args[1]=DELazG then print(`DELazG(F,x,n,K): inputs a hyperexponential function F (cont. in x, discrete in n) in the cont. variable x and the discrete variable n`): print(`and outputs a(K)/b(K) where a(n),b(n) are solutions of the recurrence satisfied by the controur integral of F around the origin`): print(`with initial conditions [1,0,...0] and [0,1,...] respectively. It also gives you the estimated delta of the sequence. Try:`): print(`DELazG((1/x+1+x)^n/x,x,n,1000);`): print(`a:=17; DELazG(((1+a*x)*(1+(a+1)*x)/x)^n/x*x^(1/3),x,n,1000); solve(64+144*x*(1+2*a)+108*x^2*(3*a^2+3*a+1)+27*x^3*(1+2*a),x)[1];`): print(`b:=17; DELazG(((1+b*x)*(1+(b+1)*x)/x)^n/x*x^(1/2),x,n,1000); -3*b-3/2-3*(b^2+b)^(1/2); `): elif nargs=1 and args[1]=DELazGv then print(`DELazGv(F,x,n,K): a verbose form of DELazG(F,x,n,K) (q.v.)`): print(`Try:`): print(`a:=17; DELazGv(((1+a*x)*(1+(a+1)*x)/x)^n/x*x^(1/3),x,n,1000); solve(64+144*x*(1+2*a)+108*x^2*(3*a^2+3*a+1)+27*x^3*(1+2*a),x)[1];`): print(`b:=17; DELazGv(((1+b*x)*(1+(b+1)*x)/x)^n/x*x^(1/2),x,n,1000); -3*b-3/2-3*(b^2+b)^(1/2); `): elif nargs=1 and args[1]=DELmaz then print(`DELmaz(a,b,c,K): inputs positive integers a,b,c, and outputs the Apery limit for the operaor OpeMAZ1(a,b,c,n,N) (q.v.( wuth initial conditions a(1)=1 and the rest 0, b(0)=1 and the rest 0. Try:`): print(`DELmaz(1,1,1,1000);`): elif nargs=1 and args[1]=FindAZ1 then print(`FindAZ1(x,A,K): Inputs a positive integer d, a variable x, a positive integer A and a large positive integer K`): print(`outputs the list of pairs [P,delta] such that P is a Laurent polynomial of low-degree -1, degree 1, and the coefficients`): print(`are positive integers between 1 and A, and the implied delta (using s sequence of length 2*K), in the Apery limit of the recurrence`): print(`satisfied by the constant term of P^n yields a positive delta, followed by a conjectured value (produced by`): print(`Maple, identified or own, if known. Try:`): print(`FindAZ1(x,3,300);`): elif nargs=1 and args[1]=FindAZ2 then print(`FindAZ2(x,A,K): Inputs a positive integer d, a variable x, a positive integer A and a large positive integer K`): print(`outputs the list of pairs [P,delta] such that P is a Laurent polynomial of low-degree -2, degree 2, and the coefficients`): print(`are positive integers between 1 and A, and the implied delta (using s sequence of length 2*K), in the Apery limit of the recurrence`): print(`satisfied by the constant term of P^n yields a positive delta, followed by a conjectured value (produced by`): print(`Maple, identified or own, if known. Try:`): print(`FindAZ2(x,3,300);`): elif nargs=1 and args[1]=FindMAZ then print(`FindMAZ(A,K): Inputs a positive integer A and a large positive integer K`): print(`outputs the list of pairs [[a,b,c],DELmaz(a,b,c,K)] such that DELmaz(a,b,c,K)[2] is positive`): print(`for all 1<=a,b,c,<=A. Try`): print(`FindMAZ(1,1000);`): elif nargs=1 and args[1]=FindZ1 then print(`FindZ1(A,n,k,K): Inputs a positive integer A and a large positive integer K`): print(`outputs the list of pairs [F,DEL(F,k,n,K)] such that F is an expression of the form binomial(n,k)*binomial(a1*n+b1*k,a2*n+b2*k)*x^k`): print(`where a1 is from 1 to A and b1 from 0 to A and a2<=a1 and b2<=b1 and x is between 1 and A`): print(`such that DEL(F,k,n,K)[2] is positive. Try:`): print(`FindZ1(1,n,k,300);`): elif nargs=1 and args[1]=FindZ2 then print(`FindZ2(A,n,k,K): Inputs a positive integer A and a large positive integer K`): print(`outputs the list of pairs [F,DEL(F,k,n,K)] such that F is an expression of the form binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k`): print(`where a1 is from 1 to A and b1 from 0 to A and a2<=a1 and b2<=b1 and x is between 1 and A`): print(`such that DEL(F,k,n,K)[2] is positive. Try:`): print(`FindZ2(1,n,k,300);`): elif nargs=1 and args[1]=GEk then print(`GEk(k,a,x): Guesses a polynomial equation in x, for numeric a (pos. integer) and pos. integer k>1, for DELazG(((1 + a * x) * (1 + (a + 1) * x) / x)^n / x^(1 / k), x, n, 1000)[1]:`): print(`Try: GEk(3,13,x);`): elif nargs=1 and args[1]=guessGEk then print(`guessGEk(k,a,N): Guesses polynomial expressions for the coefficients of the polynomials GEk(k, a, x) using terms a = 1..N.`): print(`Try: guessGEk(3,a,3);`): elif nargs=1 and args[1]=guessPol then print(`guessPol(L, x): Guesses a polynomial of minimal degree that generates the list L.`): print(`Try: guessPol([1, 4, 9, 16, 25], n):`): elif nargs=1 and args[1]=MyIDs then print(`MyIDs(C,F,F0,N): Given a constant C in decimals and another constant`): print(`let's call it F, whose floating-point if F0`): print(` and a positive integer N`): print(`tries to express C as (a*F+b)/(c*F+d) for a,b,c,d from -N to N using PSLQ`): print(`MyIDs(evalf((log(2)-2)/(2*log(2)+3)),log(2),evalf(log(2)),100);`): elif nargs=1 and args[1]=MyIDsLog then print(`MyIDsLog(C,K,N): guesses a fractional-linear expression for the constant C with coefficients <=N in aba. value (given in floating point) in terms of log(j/i) where 2<=i ) # ## and then type: read EKHAD : # ## Then follow the instructions given there # ## # ## Written by Doron Zeilberger, Rutgers University , # ## zeilberg@math.rutgers.edu. # ####################################################################### with(SolveTools): solve1:=Linear: ezraEKHAD:=proc() if args=NULL then print(`EKHAD`): print(`A Maple package for proving Hypergeometric (Binomial Coeff.)`): print(` and other kinds of identities`): print(`This version is for Maple 8 (thanks to Drew Sills for noticing).`): print(`The version (Feb, 25, 1999) is much faster than the previous`): print(`version, thanks to a SLIGHT (yet POWERFUL) modification suggested by`): print(` FREDERIC CHYZAK `): print(``): print(`For help with a specific procedure, type "ezra(procedure_name);"`): print(`Contains procedures: `): print(`findrec,ct,zeil,zeilpap,zeillim,AZd,AZdI, AZc,AZcI, AZpapd,AZpapc,celine, TerryTao `): fi: if nops([args])=1 and op(1,[args])=`celine` then print(`celine(FUNCTION,ORDER_n,ORDER_k) applies Sister Celine's technique`): print(`It inputs a function (n,k)->FUNCTION, and the guessed orders in`): print(`n and k, ORDER_n,ORDER_k respectively, and outputs a partial`): print(`k-free recurrence`): print(`it also finds the telescoped form of the recurrence.`): print(` In input, do not raise products of factorials to powers; `): print(`instead raise each factorial to the power. `): print(`For example:celine((n,k)->binomial(n,k),1,1);`): print(`celine ((n,k)->n!*(2*k)!*(-2)^(n-k)/(k!^3*(n-k)!),2,2);`): fi: if nops([args])=1 and op(1,[args])=`findrec` then print(`findrec(f,DEG,ORDER,n,N) finds empirically an ordi. linear recurrence`): print(` with polynomial coeffs. The input is a sequence f given as a list`): print(`STARTING at f[1],i.e. f[0] is not considered`): print(` where DEG:=the maximal degree of the coefficients`): print(`and ORDER:=the order of the recurrence. The output is the operator`): print(` in n and N, where N is the forward unit shift: Nf(n):=f(n+1).`): print(`For example findrec([1,1,2,3,5,8,13,21,34],0,2,n,N) should yield`): print(`N^2-N-1 , and findrec([1,2,5,14,42,132,429],1,1,m,M) should yield`): print(`(m+2)*M-(4*m+2). If there is not enough data, you will get an`): print(`an error message. If there is no operator, you would get 0`): fi: if nops([args])=1 and op(1,[args])=`AZpapc` then print(`AZpapc(INTEGRAND,y,x) inputs a hypergeometric integrand`): print(`in the continuous variables y and x (i.e. the logarithmic derivatives`): print(`diff(INTEGRAND,x)/INTEGRAND and diff(INTEGRAND,y)/INTEGRAND are`): print(`rational functions in x and y)`): print(`and outputs a paper with a proof of the linear differential equation`): print(`that the definite integral w.r.t. to y (which is a function of x)`): print(`satisfies. It uses the method of`): print(`Gert Almkvist and Doron Zeilberger, "The method of differentiating`): print(`under the integral sign", J. Symbolic Computation 10(1990), 571-591.`): print(``): print(`It could be used to establish the diff. eq. of the `): print(`classical orthogonal polynomials, when they are defined in terms`): print(`or their generating funtion.`): print(`For example for `): print(`the differential equation satisfied by the Legendre polynomials. Try:`): print(`For example AZpapc(1/sqrt(1-2*x*t+t^2)/t^(n+1),t,x); `): fi: if nops([args])=1 and op(1,[args])=`AZpapd` then print(`AZpapd(INTEGRAND,x,n) inputs a hypergeometric integrand`): print(`in the continuous variable x and the discrete variable n`): print(`i.e. i.e. A(x,n+1)/A(x,n) and A'(x,n)/A(x,n) are rational functions`): print(`of (x,n)),`): print(`and outputs a paper with a proof of the linear recurrence equation`): print(`that the definite integral w.r.t. to y (which is a function of n)`): print(`assuming that the integrand (or rather it times the certificate`): print(`vanishes at the endpoints, or it is a contour integrals`): print(`satisfies. It assumes the following: A(x,n) is not a product of`): print(`of a function of n and a function of x`): print(`It uses the method of`): print(`Gert Almkvist and Doron Zeilberger, "The method of differentiating`): print(`under the integral sign", J. Symbolic Computation 10(1990), 571-591`): print(`It could be used to establish the recurrences of the `): print(`classical orthogonal polynomials, when they are defined in terms`): print(`or their generating funtion`): print(`For example for `): print(`the recurrence, and proof, satisfied by the Legendre polynomials, try: `): print(`AZpapd(1/sqrt(1-2*x*t+t^2)/t^(n+1),t,n) ; `): fi: if nops([args])=1 and op(1,[args])=`AZd` then print(`AZd(A,x,n,N) finds a recurrence of order ORDER<=8`): print(`phrased in terms of n, and the shift in n, N`): print(`for the integral of A(x,n) with respect to x, whenever A(x,n) is`): print(`hypergeometric in (x,n),i.e. A(x,n+1)/A(x,n) and A'(x,n)/A(x,n) are`): print(`rational funtions of x and n. It follows the algorithn of`): print(`Gert Almkvist and Doron Zeilberger, "The method of differentiating`): print(`under the integral sign", J. Symbolic Computation 10(1990), 571-591`): print(`A should not be a product of a function of x and a function of n.`): print(``): print(`AZd(A,x,n,N) returns the expression seq. ope(n,N),cert(x,n)`): print(`satisfying ope(n,N)A(x,n)=diff(cert(x,n)*A(x,n),x).`): print(`If no recurrence is found, it returns 0.`): print(``): print(`A verbose version is AZpapd(A,x,n), type ezra(AZpapd) for details.`): print(``): print(`For example for `): print(`the recurrence equation and proof certificate, for the Legendre polct:ynomials. Try: `): print(`AZd(1/sqrt(1-2*x*t+t^2)/t^(n+1),t,n,N) ; `): fi: if nops([args])=1 and op(1,[args])=`AZdI` then print(`AZdI(A,x,n,N,a,b) finds an INHOMOGENEOUS recurrence of order ORDER<=8`): print(`phrased in terms of n, and the shift in n, N`): print(`for the integral of A(x,n) with respect to x, from x=a to x=b, whenever A(x,n) is`): print(`hypergeometric in (x,n),i.e. A(x,n+1)/A(x,n) and A'(x,n)/A(x,n) are`): print(`rational funtions of x and n. It follows the algorithn of`): print(`Gert Almkvist and Doron Zeilberger, "The method of differentiating`): print(`under the integral sign", J. Symbolic Computation 10(1990), 571-591`): print(`A should not be a product of a function of x and a function of n.`): print(``): print(`AZd(A,x,n,N) returns the pair [ope(n,N),rhs(n)],cert(x,n)]`): print(`satisfying ope(n,N)A(x,n)=diff(cert(x,n)*A(x,n),x).`): print(`and rhs(n) is the right hand side of the inhomogeneous recurrence`): print(`If no recurrence is found, it returns 0.`): print(``): print(``): print(`For example try: `): print(`AZdI(x^n/(1+x^2),x,n,N,-1,1) ; `): fi: if nops([args])=1 and op(1,[args])=`AZc` then print(`AZc(A,y,x,D) tries to finds a linear diff.eq. of order <=10,`): print(` phrased in terms of x, and diff.w.r.t x, D`): print(`for the integrale of A(x,y) with respect to x, whenever A(x,y) is`): print(`hypergeometric in (x,y),i.e. A_x(x,y)/A(x,y) and A_y(x,y)/A(x,y) are`): print(`rational funtions of x and y. It follows the algorithn of`): print(`Gert Almkvist and Doron Zeilberger, "The method of differentiating`): print(`under the integral sign", J. Symbolic Computation 10(1990), 571-591`): print(`AZc(A,y,x,D) returns the expression seq. ope(x,D),cert(x,n)`): print(`satisfying ope(x,D)A(x,y)=diff(cert(x,y)*A(x,y),y).`): print(`If no linear diff. eq. of order<=8 is found, it returns 0`): print(`see AZpapc for a verbose vsersion`): print(`For example, for `): print(`the diff.eq., and proof certificate for the Legendre polynomials.`): print(` AZc(1/sqrt(1-2*x*t+t^2)/t^(n+1),t,x,D); `): fi: if nops([args])=1 and op(1,[args])=`AZcI` then print(`AZcI(A,y,x,D,a,b) tries to finds an inhomogeneous linear diff.eq. of order <=10,`): print(` phrased in terms of x, and diff.w.r.t x, D`): print(`for the integrale of A(x,y) with respect to x from x=a to x=b, whenever A(x,y) is`): print(`hypergeometric in (x,y),i.e. A_x(x,y)/A(x,y) and A_y(x,y)/A(x,y) are`): print(`rational funtions of x and y. It follows the algorithn of`): print(`Gert Almkvist and Doron Zeilberger, "The method of differentiating`): print(`under the integral sign", J. Symbolic Computation 10(1990), 571-591`): print(`AZc(A,y,x,D) returns the expression seq. ope(x,D),cert(x,n)`): print(`satisfying ope(x,D)A(x,y)=diff(cert(x,y)*A(x,y),y).`): print(`If no linear diff. eq. of order<=10 is found, it returns 0`): print(`For example Try:`): print(` AZcI(1/(1-x*t-(x+1)*t^2),x,t,D,0,1); `): print(` AZcI(x*(2-x)/(1-x*t-(x+1)*t^2),x,t,D,0,2); `): fi: if nops([args])=1 and op(1,[args])=`ct` then print(` ct(SUMMAND,ORDER,k,n,N)`): print(`This is a Maple inplementation of the algorithm described in Ch. 6`): print(`of the book A=B, first proposed in : D. Zeilberger, "The method of`): print(`of creative telescoping", J.Symbolic Computation 11(1991) 195-204`): print(``): print(`finds a recurrence for SUMMAND in the parameters k and n, `): print(` of order ORDER, with N is the chosen symbol for the shift in n.`): print(``): print(`SUMMAND should be a product of factorials and/or binomial coeffs`): print(`and/or rising factorials, where (a)_k is denoted by rf(a,k)`): print(`and/or powers of k and n, and, optionally, a polynomial factor`): print(`The output consists of an operator ope(N,n) and a certificate R(n,k)`): print(`with the properties that if we define G(n,k):=R(n,k)*SUMMAND then`): print(`ope(N,n)SUMMAND(n,k)=G(n,k+1)-G(n,k)`): print(`which is a routinely verifiable identity.`): print(`For example "ct(binomial(n,k),1,k,n,N);" would yield the output`): print(` N-2, k/(k-n-1) `): fi: if nops([args])=1 and op(1,[args])=TerryTao then print(`TerryTao(P,Q,x,z,k,L,K): inputs hyper-exponential functions P and Q of the variable x, `): print(`a continuous variable z (for the certificate),`): print(`a discrete variable`): print(`k, and an affine-linear expression L in k of the form a0+b0*k for some non-negative integers a0 and b0`): print(`and a symbol,K, for the shift operator in k.`): print(`Outputs a recurrence, and a certificate (using the Almkvist-Zeilberger algorithm) for the`): print(`sequence , in k, of the functions (of x)`): print(`D_x^L(Q(x)*P(x)^k). For example, for the problem in Terry Tao's blog, May 30, 2015`): print(` A differentiation identity, type `): print(` TerryTao(1+x^2,(1+x^2)^(-1/2),x,z,k,2*k,K); `): fi: if nops([args])=1 and op(1,[args])=`zeil` then print(`The syntax is:`): print(` zeil(SUMMAND,k,n,N) or zeil(SUMMAND,k,n,N,MAXORDER) or `): print(` zeil(SUMMAND,k,n,N,MAXORDER,parameter_list) `): print(` finds a linear recurrence equation for SUMMAND, with`): print(` polynomial coefficients`): print(`of ORDER<=MAXORDER, where the default of MAXORDER is 6`): print(`in the parameter n, the shift operator in n being N`): print(`of the form ope(N,n)SUMMAND=G(n,k+1)-G(n,k)`): print(`where G(n,k):=R(n,k)*SUMMAND, and R(n,k) is the 2nd item of output.`): print(`The output is ope(N,n),R(n,k) .`): print(`For example zeil(binomial(n,k),k,n,N) would yield`): print(` N-2, k/(k-n-1) `); print(` in which N-2 is the "ope" operator, and k/(k-n-1) is R(n,k) `); print(`SUMMAND should be a product of factorials and/or binomial coeffs`): print(`and/or rising factorials, where (a)_k is denoted by rf(a,k)`): print(`and/or powers in k and n, and, optionally, a polynomial factor.`): print(``): print(`The last optional parameter, is the list of other parameters,`): print(`if present. Giving them causes considerable speedup. For example`): print(` zeil(binomial(n,k)*binomial(a,k)*binomial(b,k),k,n,N,6,[a,b])`): fi: if nops([args])=1 and op(1,[args])=`zeilpap` then print(` zeilpap(SUMMAND,k,n) or zeilpap(SUMMAND,k,n,NAME,REF)`): print(`Just like zeil but writes a paper with the proof`): print(`NAME and REF are optional name and reference`): print(`Warning: It assumes that the definite summation w.r.t. k`): print(`extends over all k where it is non-zero, and that it is zero`): print(`for other k`): print(`For non-natural summation limits, use zeillim`): fi: if nops([args])=1 and op(1,[args])=`zeillim` then print(` zeillim(SUMMAND,k,n,N,alpha,beta) `): print(`Similar to zeil(SUMMAND,k,n,N) but outputs a recurrence for `): print(` the sum of SUMMAND from k=alpha to k=n-beta .`): print(`Outputs the recurrence operator, certificate and right hand side.`): print(`Note carefully: The upper limit of the sum will be n-beta, not beta. `): print(`For example, "zeillim(binomial(n,k),k,n,N,0,1);" gives output of `): print(` N-2, k/(k-n-1),1 `): print(` which means that SUM(n):=2^n-1 satisfies the recurrence `): print(` (N-2)SUM(n)=1, as certified by R(n,k):=k/(k-n-1) `): fi: end: #yafe just translates from operator notation to everyday notation yafe:=proc(ope,N,n,SUM) local gu,i: gu:=0: for i from 0 to degree(ope,N) do gu:=gu+coeff(ope,N,i)*subs(n=n+i,SUM): od: gu: end: yafec:=proc(ope,D,x,INTEGRAND) local gu,i: gu:=coeff(ope,D,0)*INTEGRAND: for i from 1 to degree(ope,D) do gu:=gu+coeff(ope,D,i)*diff(INTEGRAND,x$i): od: gu: end: simplify1:=proc(bitu,k,a) local gu,gu1,i,khez,sp: sp:=1: gu:=bitu: if type(gu,`*`) then for i from 1 to nops(gu) do gu1:=op(i,gu): if type(gu1,`^`) and type(op(2,gu1), integer) then khez:=op(2,gu1): gu1:=op(1,gu1): sp:=sp*simplify(subs(k=k+a,gu1)/gu1)^khez: else sp:=sp*simplify(subs(k=k+a,gu1)/gu1): fi: od: elif type(gu,`^`) and type(op(2,gu), integer) then khez:=op(2,gu): gu1:=op(1,gu): sp:=sp*simplify(subs(k=k+a,gu1)/gu1)^khez: else sp:=simplify(subs(k=k+a,gu)/gu): fi: sp: end: rf:=proc(a,b): (a+b-1)!/(a-1)!: end: RootOf1:=proc(f,x) local kv,kvi,i: kv:=[solve(f=0,x)]: kvi:={}: for i from 1 to nops(kv) do if type(kv[i],integer) and kv[i]>0 then kvi:=kvi union {kv[i]} fi: od: RETURN(kvi): end: pashet:=proc(p,N) local i,gu1,gu,p1: p1:=normal(p): gu1:=denom(p1): p1:=numer(p1): p1:=expand(p1): gu:=0: for i from 0 to degree(p,N) do gu:=gu+factor(coeff(p1,N,i))*N^i: od: RETURN(gu/gu1): end: hafel:=proc(POL,SUMMAND,ope,n,N) local i,FAC,degg,bi,rat,POL1,SUMMAND1,zub: degg:=degree(ope,N): FAC:=0: for i from 0 to degg do bi:=coeff(ope,N,i): rat:=simplify1(SUMMAND,n,i): FAC:=FAC+bi*subs(n=n+i,POL)*rat: FAC:=normal(FAC): od: POL1:=numer(FAC): zub:=denom(FAC): SUMMAND1:=SUMMAND/zub: RETURN(POL1,SUMMAND1,zub): end: ctold:=proc(SUMMAND,ORDER,k,n,N) local gu,i,ope,POL1,SUMMAND1,yakhas,P,Q,R,j,res1,kv,hakhi,g, A1, B1, P1, SDZ, SDZ1, degg, eq, fu, gugu, i1, ia1, k1, kvutsa, l1, l2, meka1, mekb1, mumu, va1, va2,ope1,denFAC,ope1a: if nargs<>5 then ERROR(`Syntax: ct(SUMMAND,ORDER,summation_variable,auxiliary_var, Shift_n)`): fi: ope:=0: for i from 0 to ORDER do ope:=ope+bpc[i]*N^i: od: gu:=hafel(1,convert(SUMMAND,factorial),ope,n,N): POL1:=gu[1]: SUMMAND1:=gu[2]: denFAC:=gu[3]: yakhas:=simplify1(SUMMAND1,k,-1): yakhas:=normal(1/yakhas): print(`yakhas is`,yakhas): P1:=1: Q:=numer(yakhas): R:=denom(yakhas): res1:=resultant(Q,subs(k=k+j,R),k): print(`res1 is`,res1): kv:=RootOf1(res1,j): print(`kv is`,kv): while nops(kv) > 0 do hakhi:=max(op(kv)): g:=gcd(Q,subs(k=k+hakhi,R)): Q:=normal(Q/g): R:=normal(R/subs(k=k-hakhi,g)): P1:=P1*product(subs(k=k-i1,g),i1=0..hakhi-1): res1:=resultant(Q,subs(k=k+j,R),k): kv:=RootOf1(res1,j): od: P:=POL1*P1: A1:=subs(k=k+1,Q)+R: A1:=expand(A1): B1:=subs(k=k+1,Q)-R: B1:=expand(B1): l1:=degree(A1,k): if B1=0 then l2:=-100: else l2:=degree(B1,k): fi: meka1:=coeff(A1,k,l1): mekb1:=coeff(B1,k,l2): if l1<=l2 then k1:=degree(P,k)-l2: elif l2=l1-1 then mumu:= (-2)*mekb1/meka1: if type(mumu,integer) then k1:=max(mumu, degree(P,k)-l1+1): else k1:=degree(P,k)-l1+1: fi: elif l2 < l1-1 then k1:= max( 0, degree(P,k)-l1+1 ): fi: fu:=0: print(`k1 is`,k1): if k1 < 0 then RETURN(0): fi: if k1 >= 0 then for ia1 from 0 to k1 do fu:=fu+apc[ia1]*k^ia1: od: gugu:=subs(k=k+1,Q)*fu-R*subs(k=k-1,fu)-P: gugu:=expand(gugu): degg:=degree(gugu,k): for ia1 from 0 to degg do eq[ia1+1]:=coeff(gugu,k,ia1)=0: od: for ia1 from 0 to k1 do va1[ia1+1]:=apc[ia1]: od: for ia1 from 0 to ORDER do va2[ia1+1]:=bpc[ia1]: od: eq:=convert(eq,set): va1:=convert(va1,set): va2:=convert(va2,set): va1:=va1 union va2: va1:=solve1(eq,va1): kvutsa:={va1}: fu:=subs(va1,fu): ope:=subs(va1,ope): fi: if ope=0 or kvutsa={} or fu=0 then RETURN(0): fi: gu:={}: for i1 from 0 to k1 do gu:=gu union {apc[i1]=1}: od: for i1 from 0 to ORDER do gu:=gu union {bpc[i1]=1}: od: fu:=subs(gu,fu): ope:=subs(gu,ope): ope:=pashet(ope,N): ope1:=ope*denom(ope): SDZ:=denom(ope)*subs(k=k+1,Q)*fu/P1/denFAC : SDZ1:=subs(k=k-1,SDZ)*simplify1(convert(SUMMAND,factorial),k,-1): SDZ1:=simplify(SDZ1): ope1a:=0: for i from 0 to degree(ope1,N) do ope1a:=ope1a+sort(coeff(ope1,N,i)*N^i): od: RETURN(ope1a,SDZ1): end: ct:=proc(SUMMAND,ORDER,k,n,N) local gu,i,ope,POL1,SUMMAND1,yakhas,P,Q,R,j,res1,kv,hakhi,g, A1, B1, P1, SDZ, SDZ1, degg, eq, fu, gugu, i1, ia1, k1, kvutsa, l1, l2, meka1, mekb1, mumu, va1, va2,ope1,denFAC,ope1a: if nargs<>5 then ERROR(`Syntax: ct(SUMMAND,ORDER,summation_variable,auxiliary_var, Shift_n)`): fi: if tovu(convert(SUMMAND,factorial),k,n)=0 then ERROR(`The summand can be separated into f(`,k,`)g(`,n,`)`): fi: ope:=0: for i from 0 to ORDER do ope:=ope+bpc[i]*N^i: od: gu:=hafel(1,convert(SUMMAND,factorial),ope,n,N): POL1:=gu[1]: SUMMAND1:=gu[2]: denFAC:=gu[3]: yakhas:=simplify1(SUMMAND1,k,-1): yakhas:=normal(1/yakhas): P1:=1: Q:=numer(yakhas): R:=denom(yakhas): res1:=findgQR(Q,R,k,100): while res1[2]<>0 do g:=res1[1]: hakhi:=res1[2]: Q:=normal(Q/g): R:=normal(R/subs(k=k-hakhi,g)): P1:=P1*product(subs(k=k-i1,g),i1=0..hakhi-1): res1:=findgQR(Q,R,k,100): od: P:=POL1*P1: A1:=subs(k=k+1,Q)+R: A1:=expand(A1): B1:=subs(k=k+1,Q)-R: B1:=expand(B1): l1:=degree(A1,k): if B1=0 then l2:=-100: else l2:=degree(B1,k): fi: meka1:=coeff(A1,k,l1): mekb1:=coeff(B1,k,l2): if l1<=l2 then k1:=degree(P,k)-l2: elif l2=l1-1 then mumu:= (-2)*mekb1/meka1: if type(mumu,integer) then k1:=max(mumu, degree(P,k)-l1+1): else k1:=degree(P,k)-l1+1: fi: elif l2 < l1-1 then k1:= max( 0, degree(P,k)-l1+1 ): fi: fu:=0: if k1 < 0 then RETURN(0): fi: if k1 >= 0 then for ia1 from 0 to k1 do fu:=fu+apc[ia1]*k^ia1: od: gugu:=subs(k=k+1,Q)*fu-R*subs(k=k-1,fu)-P: gugu:=expand(gugu): degg:=degree(gugu,k): for ia1 from 0 to degg do eq[ia1+1]:=coeff(gugu,k,ia1)=0: od: for ia1 from 0 to k1 do va1[ia1+1]:=apc[ia1]: od: for ia1 from 0 to ORDER do va2[ia1+1]:=bpc[ia1]: od: eq:=convert(eq,set): va1:=convert(va1,set): va2:=convert(va2,set): va1:=va1 union va2: va1:=solve1(eq,va1): kvutsa:={va1}: fu:=subs(va1,fu): ope:=subs(va1,ope): fi: if ope=0 or kvutsa={} or fu=0 then RETURN(0): fi: gu:={}: for i1 from 0 to k1 do gu:=gu union {apc[i1]=1}: od: for i1 from 0 to ORDER do gu:=gu union {bpc[i1]=1}: od: fu:=subs(gu,fu): ope:=subs(gu,ope): ope:=pashet(ope,N): ope1:=ope*denom(ope): SDZ:=denom(ope)*subs(k=k+1,Q)*fu/P1/denFAC : SDZ1:=subs(k=k-1,SDZ)*simplify1(convert(SUMMAND,factorial),k,-1): SDZ1:=simplify(SDZ1): ope1a:=0: for i from 0 to degree(ope1,N) do ope1a:=ope1a+sort(coeff(ope1,N,i)*N^i): od: RETURN(ope1a,SDZ1): end: cttry:=proc(SUMMAND,ORDER,k,n,resh,N) local gu,i,ope,POL1,SUMMAND1,yakhas,P,Q,R,j,res1,kv,hakhi,g, A1, B1, P1, degg, eq, fu, gugu, i1, ia1, k1, kvutsa, l1, l2, meka1, mekb1, mumu, va1, va2,eqg: if nargs<>6 then ERROR(`The syntax is cttry(term,ORDER,sum_variable,aux_var,para_list,Shift)`): fi: if tovu(convert(SUMMAND,factorial),k,n)=0 then ERROR(`The summand can be separated into f(`,k,`)g(`,n,`)`): fi: ope:=0: for i from 0 to ORDER do ope:=ope+bpc[i]*N^i: od: gu:=hafel(1,convert(SUMMAND,factorial),ope,n,N): POL1:=gu[1]: SUMMAND1:=gu[2]: yakhas:=simplify1(SUMMAND1,k,-1): yakhas:=normal(1/yakhas): P1:=1: Q:=numer(yakhas): R:=denom(yakhas): res1:=findgQR(Q,R,k,100): while res1[2]<>0 do g:=res1[1]: hakhi:=res1[2]: Q:=normal(Q/g): R:=normal(R/subs(k=k-hakhi,g)): P1:=P1*product(subs(k=k-i1,g),i1=0..hakhi-1): res1:=findgQR(Q,R,k,100): od: P:=POL1*P1: A1:=subs(k=k+1,Q)+R: A1:=expand(A1): B1:=subs(k=k+1,Q)-R: B1:=expand(B1): l1:=degree(A1,k): if B1=0 then l2:=-100: else l2:=degree(B1,k): fi: meka1:=coeff(A1,k,l1): mekb1:=coeff(B1,k,l2): if l1<=l2 then k1:=degree(P,k)-l2: if k1=FAIL then RETURN(0): fi: elif l2=l1-1 then mumu:= (-2)*mekb1/meka1: if type(mumu,integer) then k1:=max(mumu, degree(P,k)-l1+1): else k1:=degree(P,k)-l1+1: fi: elif l2 < l1-1 then k1:= max( 0, degree(P,k)-l1+1 ): fi: fu:=0: if k1 < 0 then RETURN(0): fi: if k1 >= 0 then for ia1 from 0 to k1 do fu:=fu+apc[ia1]*k^ia1: od: gugu:=subs(k=k+1,Q)*fu-R*subs(k=k-1,fu)-P: gugu:=expand(gugu): degg:=degree(gugu,k): for ia1 from 0 to degg do eq[ia1+1]:=coeff(gugu,k,ia1)=0: od: for ia1 from 0 to k1 do va1[ia1+1]:=apc[ia1]: od: for ia1 from 0 to ORDER do va2[ia1+1]:=bpc[ia1]: od: eq:=convert(eq,set): va1:=convert(va1,set): va2:=convert(va2,set): va1:=va1 union va2: eqg:=subs(n=1/2,eq): for i from 1 to nops(resh) do eqg:=subs(op(i,resh)=i^2+3,eqg): od: va1:=solve1(eq,va1): kvutsa:={va1}: fu:=subs(va1,fu): ope:=subs(va1,ope): fi: if ope=0 or kvutsa={} or fu=0 then RETURN(0): else RETURN(1): fi: end: paper:=proc(SUMMAND,k,n,N,ope1,SDZ1,NAME,REF) local SHEM,IDENTITY,RECURRENCE: if degree(ope1,N)=1 then SHEM:=IDENTITY: else SHEM:=RECURRENCE: fi: print(``): print(`A PROOF OF THE`,NAME,SHEM): print(``): print(`By Shalosh B. Ekhad,Rutgers University, c/o zeilberg@math.rutgers.edu`): print(``): print(`I will give a short proof of the following result(`,REF,`).`): print(``): if degree(ope1,N)=1 then print(`(Note that since the recurrence below is first order, this`): print(`means that the sum`, SUM(n), `has closed form,and it is`): print(`easily seen to be equivalent.)`): print(``): fi: print(`Theorem:Let`, F(n,k), `be given by`): print(``): print(SUMMAND): print(``): print(`and let`, SUM(n),`be the sum of`, F(n,k),` with`): print(`respect to`, k): print(``): print(SUM(n),` satisfies the following linear recurrence equation`): print(``): print(yafe(ope1,N,n,SUM(n))): print(`=0.`): print(``): print(`PROOF: We cleverly construct`, G(n,k),`:=`): print(``): print(SDZ1*SUMMAND): print(`with the motive that`): print(``): print(yafe(ope1,N,n,F(n,k)) = G(n,k+1)-G(n,k), `(Check!)`): print(``): print(`and the theorem follows upon summing with respect to`, k,`. QED.`): end: paper3:=proc(SUMMAND,k,n,N,ope1,SDZ1): print(``): print(`A PROOF OF A RECURRENCE`): print(``): print(`By Shalosh B. Ekhad, Rutgers University `): print(``): print(`Theorem: Let`, F(n,k), `be given by`): print(``): print(SUMMAND): print(``): print(`and let`, SUM(n),`be the sum of`, F(n,k),` with`): print(`respect to`, k): print(``): print(SUM(n),` satisfies the following linear recurrence equation`): print(``): print(yafe(ope1,N,n,SUM(n))): print(`=0.`): print(``): print(`PROOF: We cleverly construct`, G(n,k),`:=`): print(``): print(SDZ1*SUMMAND): print(`with the motive that`): print(``): print(yafe(ope1,N,n,F(n,k))=G(n,k+1) - G(n,k), `(Check!)`): print(``): print(`and the theorem follows upon summing with respect to`, k,`. QED.`): end: paperc:=proc(INTEGRAND,y,x,D,ope1,SDZ1): print(``): print(``): print(`A PROOF OF A DIFFERENTIAL EQUATION SATISFIED BY AN INTEGRAL`): print(``): print(`By Shalosh B. Ekhad, Rutgers University, c/o zeilberg@math.rutgers.edu`): print(``): print(`I will give a short proof of the following result.`): print(``): print(`Theorem:Let`, F(x,y), `be given by`): print(``): print(INTEGRAND): print(``): print(`and let`, INTEGRAL(x),`be the integral of`, F(x,y),` with`): print(`respect to`, y): print(``): print(INTEGRAL(x),` satisfies the following linear differential equation`): print(``): print(yafec(ope1,D,x,INTEGRAL(x))): print(`=0.`): print(``): print(`PROOF: We cleverly construct`, G(x,y),`:=`): print(``): print(SDZ1*INTEGRAND): print(`with the motive that`): print(``): print(yafec(ope1,D,x,F(x,y)) = diff(G(x,y),y), `(Check!)`): print(``): print(`and the theorem follows upon integrating with respect to`, y): end: paperd:=proc(INTEGRAND,x,n,N,ope1,SDZ1): print(``): print(`A PROOF OF A LINEAR RECURRENCE SATISFIED BY AN INTEGRAL`): print(``): print(`By Shalosh B. Ekhad, Rutgers University, c/o zeilberg@math.rutgers.edu`): print(``): print(`I will give a short proof of the following result.`): print(``): print(`Theorem:Let`, F(n,x), `be given by`): print(``): print(INTEGRAND): print(``): print(`and let`, INTEGRAL(n),`be the integral of`, F(n,x),` with`): print(`respect to`, x): print(``): print(INTEGRAL(n),` satisfies the following linear recurrence equation`): print(``): print(yafe(ope1,N,n,INTEGRAL(n))): print(`=0.`): print(``): print(`PROOF: We cleverly construct`, G(n,x),`:=`): print(``): print(SDZ1*INTEGRAND): print(`with the motive that`): print(``): print(yafe(ope1,N,n,F(n,x)) = diff(G(n,x),x)): print(``): print(`and the theorem follows upon integrating with respect to`, x,`. QED.`): end: paperc:=proc(INTEGRAND,y,x,D,ope1,SDZ1): print(`A PROOF OF A DIFFERENTIAL EQUATION SATISFIED BY AN INTEGRAL`): print(``): print(`By Shalosh B. Ekhad, Rutgers University`): print(``): print(`I will give a short proof of the following result.`): print(``): print(`Theorem:Let`, F(x,y), `be given by`): print(``): print(INTEGRAND): print(``): print(`and let`, INTEGRAL(x),`be the integral of`, F(x,y),` with`): print(`respect to`, y): print(``): print(INTEGRAL(x),` satisfies the following linear differential equation`): print(``): print(yafec(ope1,D,x,INTEGRAL(x))): print(`=0.`): print(``): print(`PROOF: We cleverly construct`, G(x,y),`:=`): print(``): print(SDZ1*INTEGRAND): print(`with the motive that`): print(``): print(yafec(ope1,D,x,F(x,y)) = diff(G(x,y),y), `(Check!)`): print(``): print(`and the theorem follows upon integrating with respect to`, y,`. QED.`): end: zeil4:=proc(SUMMAND,k,n,N) local ORDER,MAXORDER,gu,gu1,resh: MAXORDER:=6: resh:=[]: if simplify1(SUMMAND,n,1)=1 then ERROR(`Summand does not depend on`,n,` hence the sum is identically constant`): fi: for ORDER from 0 to MAXORDER do gu1:=cttry(SUMMAND,ORDER,k,n,resh,N): if gu1=1 then gu:=ct(SUMMAND,ORDER,k,n,N): if gu<>0 then RETURN(gu): fi: fi: od: FAIL: end: zeil5:=proc(SUMMAND,k,n,N,MAXORDER) local ORDER,gu,gu1,resh: resh:=[]: if simplify1(SUMMAND,n,1)=1 then ERROR(`Summand does not depend on`,n,` hence the sum is identically constant`): fi: for ORDER from 0 to MAXORDER do gu1:=cttry(SUMMAND,ORDER,k,n,resh,N): if gu1=1 then gu:=ct(SUMMAND,ORDER,k,n,N): if gu<>0 then RETURN(gu): fi: fi: od: FAIL: end: zeil6:=proc(SUMMAND,k,n,N,MAXORDER,resh) local ORDER,gu,gu1: if simplify1(SUMMAND,n,1)=1 then ERROR(`Summand does not depend on`,n,` hence the sum is identically constant`): fi: for ORDER from 0 to MAXORDER do gu1:=cttry(SUMMAND,ORDER,k,n,resh,N): if gu1=1 then gu:=ct(SUMMAND,ORDER,k,n,N): if gu<>0 then RETURN(gu): fi: fi: od: FAIL: end: zeil:=proc(): if nargs=4 then zeil4(args): elif nargs=5 then zeil5(args): elif nargs=6 then zeil6(args): else print(`zeil(SUMMAND,k,n,N) or zeil(SUMMAND,k,n,N,MAXORDER) or`): ERROR(`zeil(SUMMAND,k,n,N,MAXORDER,param_list)`): fi: end: zeillim:=proc(SUMMAND,k,n,N,alpha,beta) local ope,CERT,lu,k1,i,gu,lu1,lu2: gu:=Zeillim(SUMMAND,k,n,N,alpha+1,beta+1): ope:=gu[1]: CERT:=gu[2]: lu:=gu[3]: lu1:=subs(k=alpha,SUMMAND)+subs(k=n-beta,SUMMAND): lu1:=simplify(lu1): lu1:=normal(lu1): lu2:=0: for i from 0 to degree(ope,N) do lu2:=lu2+coeff(ope,N,i)*simplify(subs(n=n+i,lu1)): od: lu2:=normal(lu2): ope,CERT,normal(expand(normal(simplify(expand(normal(lu+lu2)))))): end: Zeillim:=proc(SUMMAND,k,n,N,alpha,beta) local ope,CERT,lu,k1,i,gu: gu:=zeil(SUMMAND,k,n,N): ope:=gu[1]: CERT:=gu[2]: lu:=simplify(subs(k=n-beta+1,CERT)*subs(k=n-beta+1,SUMMAND)) -simplify(subs(k=alpha,CERT)*subs(k=alpha,SUMMAND)): for i from 0 to degree(ope,N) do for k1 from 1 to i do lu:=lu+coeff(ope,N,i)*simplify(subs({n=n+i,k=n-beta+k1},SUMMAND)): od: od: gu,normal(expand(lu)): end: zeilpap3:=proc(SUMMAND,k,n) local SDZ1, gu, ope1,N: gu:=zeil4(SUMMAND,k,n,N): ope1:=gu[1]: SDZ1:=gu[2]: paper3(SUMMAND,k,n,N,ope1,SDZ1): end: zeilpap5:=proc(SUMMAND,k,n,NAME,REF) local SDZ1, gu, ope1,N: gu:=zeil4(SUMMAND,k,n,N): ope1:=gu[1]: SDZ1:=gu[2]: paper(SUMMAND,k,n,N,ope1,SDZ1,NAME,REF): end: zeilpap:=proc() if nargs=5 then zeilpap5(args): elif nargs=3 then zeilpap3(args): else ERROR(`zeilpap(SUMMAND,k,n,NAME,REF) or zeilpap(SUMMAND,k,n)`): fi: end: AZpapc:=proc(INTEGRAND,y,x) local D,SDZ1,gu,ope1: gu:=AZc(INTEGRAND,y,x,D): ope1:=gu[1]: SDZ1:=gu[2]: paperc(INTEGRAND,y,x,D,ope1,SDZ1): end: AZpapd:=proc(INTEGRAND,x,n) local D,SDZ1, gu, ope1: gu:=AZd(INTEGRAND,x,n,D): ope1:=gu[1]: SDZ1:=gu[2]: paperd(INTEGRAND,x,n,D,ope1,SDZ1): end: goremd:=proc(N,ORDER) local i, gu: gu:=0: for i from 0 to ORDER do gu:=gu+(bpc[i])*N^i: od: RETURN(gu): end: goremc:=proc(D,ORDER) local i,gu: gu:=0: for i from 0 to ORDER do gu:=gu+(bpc[i])*D^i: od: RETURN(gu): end: gzor:=proc(f,x,n) local i,gu: gu:=f: for i from 1 to n do gu:=diff(gu,x): od: RETURN(gu): end: gzor1:=proc(a,D,x) local i,gu: gu:=0: for i from 0 to degree(a,D) do gu:=gu+diff(coeff(a,D,i),x)*D^i+coeff(a,D,i)*D^(i+1): od: end: pashetd:=proc(p,N) local gu,p1,mekh,i: p1:=normal(p): mekh:=denom(p1): p1:=numer(p1): p1:=expand(p1): gu:=0: for i from 0 to degree(p1,N) do gu:=gu+factor(coeff(p1,N,i))*N^i: od: RETURN(gu,mekh): end: pashetc:=proc(p,D) local gu,p1,i,mekh: p1:=normal(p): mekh:=denom(p1): p1:=numer(p1): p1:=expand(p1): gu:=0: for i from 0 to degree(p1,D) do gu:=gu+factor(coeff(p1,D,i))*D^i: od: RETURN(gu,mekh): end: AZd:= proc(A,y,n,N) local ORDER,gu,KAMA: KAMA:=8: for ORDER from 0 to KAMA do gu:=duisd(A,ORDER,y,n,N): if gu<>0 then RETURN(gu): fi: od: 0: end: AZc:=proc(A,y,x,D) local ORDER,gu,KAMA: KAMA:=10: for ORDER from 1 to KAMA do gu:=duisc(A,ORDER,y,x,D): if gu<>0 and gu[1]<>0 then RETURN(gu): fi: od: 0: end: duisd:= proc(A,ORDER,y,n,N) local gorem, conj, yakhas,lu1a,LU1,P,Q,R,S,j1,g,Q1,Q2,l1,l2,mumu, mekb1,fu,meka1,k1,gugu,eq,ia1,va1,va2,degg,shad,KAMA,i1: KAMA:=10: gorem:=goremd(N,ORDER): conj:=gorem: yakhas:=0: for i1 from 0 to degree(conj,N) do yakhas:=yakhas+coeff(conj,N,i1)*simplify(subs(n=n+i1,A)/A): od: lu1a:=yakhas: LU1:=numer(yakhas): yakhas:=1/denom(yakhas): yakhas:=normal(diff(yakhas,y)/yakhas+diff(A,y)/A): P:=LU1: Q:=numer(yakhas): R:=denom(yakhas): j1:=0: while j1 <= KAMA do g:=gcd(R,Q-j1*diff(R,y)): if g <> 1 then Q2:=(Q-j1*diff(R,y))/g: R:=normal(R/g): Q:=normal(Q2+j1*diff(R,y)): P:=P*g^j1: j1:=-1: fi: j1:=j1+1: od: P:=expand(P): R:=expand(R): Q:=expand(Q): Q1:=Q+diff(R,y): Q1:=expand(Q1): l1:=degree(R,y): l2:=degree(Q1,y): meka1:=coeff(R,y,l1): mekb1:=coeff(Q1,y,l2): if l1-1 <>l2 then k1:=degree(P,y)-max(l1-1,l2): else mumu:= -mekb1/meka1: if type(mumu,integer) and mumu > 0 then k1:=max(mumu, degree(P,y)-l2): else k1:=degree(P,y)-l2: fi: fi: fu:=0: if k1 < 0 then RETURN(0): fi: for ia1 from 0 to k1 do fu:=fu+apc[ia1]*y^ia1: od: gugu:=Q1*fu+R*diff(fu,y)-P: gugu:=expand(gugu): degg:=degree(gugu,y): for ia1 from 0 to degg do eq[ia1+1]:=coeff(gugu,y,ia1)=0: od: for ia1 from 0 to k1 do va1[ia1+1]:=apc[ia1]: od: for ia1 from 0 to ORDER do va2[ia1+1]:=bpc[ia1]: od: eq:=convert(eq,set): va1:=convert(va1,set): va2:=convert(va2,set): va1:=va1 union va2 : va1:=solve1(eq,va1): fu:=subs(va1,fu): gorem:=subs(va1,gorem): if fu=0 and gorem=0 then RETURN(0): fi: for ia1 from 0 to k1 do gorem:=subs(apc[ia1]=1,gorem): od: for ia1 from 0 to ORDER do gorem:=subs(bpc[ia1]=1,gorem): od: fu:=normal(fu): shad:=pashetd(gorem,N): S:=lu1a*R*fu*shad[2]/P: S:=subs(va1,S): S:=normal(S): S:=factor(S): for ia1 from 0 to k1 do S:=subs(apc[ia1]=1,S): od: for ia1 from 0 to ORDER do S:=subs(bpc[ia1]=1,S): od: RETURN(shad[1],S): end: duisc:= proc(A,ORDER,y,x,D) local KAMA,gorem,conj, yakhas,lu1a,LU1,P,Q,R,S,j1,g,Q1,Q2,l1,l2,mumu, mekb1,fu,meka1,k1,gugu,eq,ia1,va1,va2,degg,i,shad: KAMA:=10: gorem:=goremc(D,ORDER): conj:=gorem: yakhas:=0: for i from 0 to degree(conj,D) do yakhas:=yakhas+normal(coeff(conj,D,i)*gzor(A,x,i)/A): yakhas:=normal(yakhas): od: lu1a:=yakhas: LU1:=numer(yakhas): yakhas:=1/denom(yakhas): yakhas:=normal(diff(yakhas,y)/yakhas+diff(A,y)/A): P:=LU1: Q:=numer(yakhas): R:=denom(yakhas): j1:=0: while j1 <= KAMA do g:=gcd(R,Q-j1*diff(R,y)): if g <> 1 then Q2:=(Q-j1*diff(R,y))/g: R:=normal(R/g): Q:=normal(Q2+j1*diff(R,y)): P:=P*g^j1: j1:=-1: fi: j1:=j1+1: od: P:=expand(P): R:=expand(R): Q:=expand(Q): Q1:=Q+diff(R,y): Q1:=expand(Q1): l1:=degree(R,y): l2:=degree(Q1,y): meka1:=coeff(R,y,l1): mekb1:=coeff(Q1,y,l2): if l1-1 <>l2 then k1:=degree(P,y)-max(l1-1,l2): else mumu:= -mekb1/meka1: if type(mumu,integer) and mumu > 0 then k1:=max(mumu, degree(P,y)-l2): else k1:=degree(P,y)-l2: fi: fi: fu:=0: if k1 < 0 then RETURN(0): fi: for ia1 from 0 to k1 do fu:=fu+apc[ia1]*y^ia1: od: gugu:=Q1*fu+R*diff(fu,y)-P: gugu:=expand(gugu): degg:=degree(gugu,y): for ia1 from 0 to degg do eq[ia1+1]:=coeff(gugu,y,ia1)=0: od: for ia1 from 0 to k1 do va1[ia1+1]:=apc[ia1]: od: for ia1 from 0 to ORDER do va2[ia1+1]:=bpc[ia1]: od: eq:=convert(eq,set): va1:=convert(va1,set): va2:=convert(va2,set): va1:=va1 union va2 : va1:=solve1(eq,va1): fu:=subs(va1,fu): gorem:=subs(va1,gorem): if fu=0 and gorem=0 then RETURN(0): fi: for ia1 from 0 to k1 do gorem:=subs(apc[ia1]=1,gorem): od: for ia1 from 0 to ORDER do gorem:=subs(bpc[ia1]=1,gorem): od: fu:=normal(fu): shad:=pashetc(gorem,D): S:=lu1a*R*fu*shad[2]/P: S:=subs(va1,S): S:=normal(S): S:=factor(S): for ia1 from 0 to k1 do S:=subs(apc[ia1]=1,S): od: for ia1 from 0 to ORDER do S:=subs(bpc[ia1]=1,S): od: shad[1],S: end: bdokcertc:=proc(A,y,x,D,ope,S) local gu,i: gu:=0: for i from 0 to degree(ope,D) do gu:=gu+coeff(ope,D,i)*simplify(gzor(A,x,i)/A): gu:=normal(gu): od: gu:=gu/simplify(diff(S*A,y)/A): normal(gu); end: bdokcertd:=proc(A,y,n,N,ope,S) local gu,i: gu:=0: for i from 0 to degree(ope,N) do gu:=gu+coeff(ope,N,i)*simplify( subs(n=n+i,A)/A): gu:=normal(gu): od: gu:=gu/simplify(diff(S*A,y)/A): normal(gu); end: bdokcto:=proc(SUMMAND1,ORDER,k,n,N) local mu,gu,i,G1,ope,lu,SUMMAND: SUMMAND:=convert(SUMMAND1,factorial): mu:=ct(SUMMAND,ORDER,k,n,N): if mu=0 then RETURN(0): fi: ope:=mu[1]: G1:=mu[2]*SUMMAND: gu:=0: for i from 0 to degree(ope,N) do gu:=gu+coeff(ope,N,i)*simplify( subs(n=n+i,SUMMAND)/SUMMAND): gu:=normal(gu): od: lu:=simplify(subs(k=k+1,G1)/SUMMAND)-mu[2]: lu:=normal(lu): normal(gu/lu); end: bdokct:=proc(SUMMAND1,ORDER,k,n,N) local mu,gu,i,G1,ope,lu,SUMMAND: SUMMAND:=convert(SUMMAND1,factorial): mu:=ct(SUMMAND,ORDER,k,n,N): if mu=0 then RETURN(0): fi: ope:=mu[1]: G1:=mu[2]*SUMMAND: gu:=0: for i from 0 to degree(ope,N) do gu:=gu+coeff(ope,N,i)*simplify1(SUMMAND,n,i): gu:=normal(gu): od: lu:=subs(k=k+1,mu[2])*simplify1(SUMMAND,k,1)-mu[2]: lu:=normal(lu): normal(gu/lu); end: findrec:=proc(f,DEGREE,ORDER,n,N) local ope,var,eq,a,i,j,n0,kv,var1,eq1,mu: if (1+DEGREE)*(1+ORDER)+2+ORDER>nops(f) then ERROR(`Insufficient data for a recurrence of order`,ORDER, `degree`,DEGREE): fi: ope:=0: var:={}: for i from 0 to ORDER do for j from 0 to DEGREE do ope:=ope+a[i,j]*n^j*N^i: var:=var union {a[i,j]}: od: od: eq:={}: for n0 from 1 to (1+DEGREE)*(1+ORDER)+2 do eq1:=0: for i from 0 to ORDER do eq1:=eq1+subs(n=n0,coeff(ope,N,i))*op(n0+i,f): od: eq:= eq union {eq1}: od: var1:=solve1(eq,var): kv:={}: for i from 1 to nops(var1) do mu:=op(i,var1): if op(1,mu)=op(2,mu) then kv:= kv union {op(1,mu)}: fi: od: ope:=subs(var1,ope): if nops(kv)>1 then print(` either DEGREE or ORDER are too high`): print(`The output is not the minimal possible operator`): fi: for i from 1 to nops(kv) do ope:=subs(op(i,kv)=1,ope): od: ope: end: celine:=proc(f,ii,jj) local m,j,l,i,tt,yy,zz,rr,xx,ss,zy, b, iii, k, n, r, zzz: m:='m':j:='j':l:='l':i:='i': iii:=ii*(jj+1)+jj: xx:=seq(b[i],i=0..iii):i:='i': ss:=numer(simplify(expand(sum(sum(b[i*(jj+1)+j]*f(n-j,k-i)/f(n,k), i=0..ii),j=0..jj)))): tt:=coeffs(collect(ss,k),k): yy:=solve1({tt},{xx}): zz:=simplify(sum(sum(b[l*(jj+1)+m]*F(n-m,k-l),l=0..ii),m=0..jj)): i:='i':j:='j':print(` ` ):print(` `):print(`The full recurrence is`): print(` `): zz:=numer(simplify(subs(yy,zz))): for i from 0 to ii do for j from 0 to jj do zz:=collect(zz,F(n-j,k-i)) od od: print(zz,`==0`);zzz:=zz: l:='l':j:='j':m:='m': r:=subs(yy,simplify(expand(sum(sum(sum(b[l*(jj+1)+m],l=j+1..ii)*simplify(expand(f(n-m,k-j)/f(n,k))),j=0..ii),m=0..jj)))): rr:=simplify(factor(simplify(r))):print(` ` ):print(` `): print(`The telescoped form is`);print(` `); zy:=factor(subs(yy,sum(simplify(sum(b[l*(jj+1)+m],l=0..ii))*F(n-m,k),m=0..jj))): print(zy,`==G(n,k)-G(n,k-1)`); print(` `); print(`where G(n,k)=R(n,k)*F(n,k) and the rational function R(n,k) is `): print(` `); rr; end: findgQR:=proc(Q,R,k,L) local j,g: for j from 1 to L do g:=gcd(Q,subs(k=k+j,R)): if degree(g,k)>0 then RETURN(g,j): fi: od: 1,0: end: tovu:=proc(SU,k,n) local gu: gu:=simplify1(simplify1(SU,n,1),k,1): if gu=1 then RETURN(0): else RETURN(1): fi: end: #TerryTao(P,Q,x,z,k,L,K): inputs hyper-exponential functions P and Q of the variable x, #a continuous variable z (for the certificate), #a discrete variable #k, and an affine-linear expression L in k of the form a0+b0*k for some non-negative integers a0 and b0 #and a symbol,K, for the shift operator in k. #Outputs a recurrence, and a certificate (using the Almkvist-Zeilberger algorithm) for the #sequence , in k, of the functions (of x) #D_x^L(Q(x)*P(x)^k). For example, for the problem in Terry Tao's blog, May 30, 2015 #A differentiation identity, type TerryTao(1+x^2,(1+x^2)^(-1/2),x,z,k,2*k,K); TerryTao:=proc(P,Q,x,z,k,L,K) : AZd(L!*subs(x=z,P)^k*subs(x=z,Q)/(z-x)^(L+1),z,k,K): end: ####start Dec. 11, 2015 paper AZdI:= proc(A,y,n,N,a,b) local ORDER,gu,KAMA,ope,cert,yemin1: KAMA:=12: for ORDER from 0 to KAMA do gu:=duisd(A,ORDER,y,n,N): if gu<>0 then ope:=gu[1]: cert:=gu[2]: yemin1:=normal(subs(y=b, normal(cert*A))-subs(y=a, normal(cert*A))): RETURN([[ope,yemin1],cert]): fi: od: 0: end: AZcI:=proc(A,y,x,D,a,b) local ORDER,gu,KAMA,ope,cert,yemin1: KAMA:=8: for ORDER from 1 to KAMA do gu:=duisc(A,ORDER,y,x,D): if gu<>0 and gu[1]<>0 then ope:=gu[1]: cert:=gu[2]: yemin1:=normal(subs(y=b, normal(cert*A))-subs(y=a, normal(cert*A))): RETURN([[ope,yemin1],cert]): fi: od: 0: end: #OperZeil(F,k,n,N): Same as zeil(F,k,n,N)[1] but an operator, ope, in decreasing powers of N, such that it is equivalent to 1-ope OperZeil:=proc(F,k,n,N) local ope,d,i,k1,n1: option remember: ope:=zeil(F,k,n,N,20)[1]: d:=degree(ope,N): ope:=expand(subs(n=n-d,ope)/N^d): ope:=1-ope/coeff(ope,N,0): [add(factor(coeff(ope,N,-i))/N^i,i=1..d),[seq(add(eval(subs({n=n1,k=k1},F)),k1=0..n1),n1=0..d-1)]]: end: #OperAZd(F,x,n,N): Same as AZe(F,x,n,N)[1] but an operator, ope, in decreasing powers of N, such that it is equivalent to 1-ope OperAZd:=proc(F,x,n,N) local ope,d,i: option remember: ope:=AZd(F,x,n,N,20)[1]: d:=degree(ope,N): ope:=expand(subs(n=n-d,ope)/N^d): ope:=1-ope/coeff(ope,N,0): add(factor(coeff(ope,N,-i))/N^i,i=1..d): end: #SeqFromRec(ope,n,N,Ini,n0,K): inputs an operator given in temrs of the negative shift operator #1/N, and a list Ini, givining the values at n=n0, ...,n=n0+L-1, finds the list from n=1 to #to n=K. Try: #SeqFromRec(1/N+1/N^2,n,N,[0,1],0,20); SeqFromRec:=proc(ope,n,N,Ini,n0,K) local d,i,T,n1,lu: lu:=denom(ope): d:=-ldegree(ope,N): if member(0,{seq(subs(n=n1,lu),n1=n0+nops(Ini)..K)}) then RETURN(FAIL): fi: for n1 from 0 to nops(Ini)-1 do T[n0+n1]:=Ini[n1+1]: od: for n1 from n0+nops(Ini) to K do T[n1]:=add( subs(n=n1,coeff(ope,N,-i))*T[n1-i],i=1..d): od: [seq(T[n1],n1=1..K)]: end: #RAT(F,k,n,K): inputs a closed-form expression and outputs a(K)/b(K) where #b(n):=Sum(F,k=0..n) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1, Try #RAT(binomial(n,k)^3,k,n,1000); RAT:=proc(F,k,n,K) local ope,N,d,Ini1,Ini2,lu1,lu2,k1,n1: ope:=OperZeil(F,k,n,N)[1]: d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[seq(add(eval(subs({n=n1,k=k1},F)),k1=0..n1),n1=0..d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,K): lu1[K]/lu2[K]: end: #RATaz(P,x,K): inputs a Laurent polynoimal P in the cont. variable x and the discrete variable n #and outputs a(K)/b(K) where #b(n):=CT(P^n,x) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1, Try #RATaz(1/x+1+x,x,1000); RATaz:=proc(P,x,K) local n,ope,N,d,Ini1,Ini2,lu1,lu2,n1: ope:=OperAZd(P^n/x,x,n,N): d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[seq(coeff(P^n1,x,0),n1=0..d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,K): Ini1:=[0$(d-2),0,1]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,K): lu1[K]/lu2[K]: end: #DEL(F,k,n,K): inputs a closed-form expression and outputs the sequence a(n)/b(n) where #b(n):=Sum(F,k=0..n) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1, #It also returns the deltas. Try: #DEL(binomial(n,k)*binomial(n+k,k)*binomial(n+2*k,k),k,n,1000); #DEL(binomial(n,k)*binomial(n+k,k)*binomial(n+2*k,k)*a^k,k,n,1000), for a=2,3,4, DEL:=proc(F,k,n,K) local ope,N,d,Ini1,Ini2,lu1,lu2,k1,n1,i,C,S,mu,mu1: ope:=OperZeil(F,k,n,N)[1]: d:=-ldegree(ope,N): if K<100 then print(K, `must be at least 100`): RETURN(FAIL): fi: if d<2 then RETURN(FAIL): fi: Ini2:=[seq(add(eval(subs({n=n1,k=k1},F)),k1=0..n1),n1=0..d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=1..2*K)]: C:=S[2*K]: mu:=evalf(C): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu:=identify(mu): else mu:=mu1: fi: mu,min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): end: #DELaz(P,x,K): inputs a Laurent polynoimal P in the cont. variable x and the discrete variable n #and outputs a(K)/b(K) where #b(n):=CT(P^n,x) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1, Try #DELaz(1/x+1+x,x,1000); DELaz:=proc(P,x,K) local n,N,ope,d,Ini1,Ini2,lu1,lu2,i,n1,S,C,mu,mu1: ope:=OperAZd(P^n/x,x,n,N): d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[seq(coeff(P^n1,x,0),n1=0..d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=1..2*K)]: C:=S[2*K]: mu:=evalf(C): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu:=identify(mu): else mu:=mu1: fi: mu,min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): end: #MyIDs(C,F,F0,N): Given a constant C in decimals and another constant #let's call it F, whose floating-point if F0 # and a positive integer N #tries to express C as (a*F+b)/(c*F+d) for a,b,c,d from -N to N using PSLQ #MyIDs(evalf((log(2)-2)/(2*log(2)+3)),log(2),evalf(log(2)),100); MyIDs:=proc(C,F,F0,N) local gu,mu,i: gu:=IntegerRelations[PSLQ]([1,evalf(C),evalf(F0),evalf(C*F0)]): if max(seq(abs(gu[i]),i=1..4)) >N then RETURN(FAIL): fi: if gu[2]+gu[4]*F0=0 then RETURN(FAIL): fi: mu:=-(gu[1]+gu[3]*F)/(gu[2]+gu[4]*F): if abs(evalf(subs(F=F0,mu)-C))>1/10^(Digits-7) then RETURN(FAIL): fi: mu: end: #MyIDsLog(C,K,N): guesses a fractional-linear expression for the constant C with coefficients <=N in aba. value (given in floating point) in terms of log(j/i) where 2<=iFAIL then RETURN(simplify(subs(F=log(i/j),gu))): fi: od: od: FAIL: end: #FindAZ1(x,A,K): Inputs a positive integer d, a variable x, a positive integer A and a large positive integer K #outputs the list of pairs [P,delta] such that P is a Laurent polynomial of low-degree -1, degree 1, and the coefficients #are positive integers between 1 and A, and the implied delta (using s sequence of length 2*K), in the Apery limit of the recurrence #satisfied by the constant term of P^n yields a positive delta, followed by a conjectured value (produced by #Maple, identified or own, if known. Try: #FindAZ1(x,3,300); FindAZ1:=proc(x,A,K) local L,a1,a2,a3,gu,P: L:=[]: for a1 from 1 to A do for a2 from 1 to A do for a3 from a1 to A do if igcd(a1,a2,a3)=1 then P:=a1/x+a2+a3*x: gu:=DELaz(P,x,K): if gu<>FAIL then if gu[2]>0 then L:=[op(L),[factor(P),gu]]: fi: fi: fi: od: od: od: L: end: #FindAZ2(x,A,K): Inputs a positive integer d, a variable x, a positive integer A and a large positive integer K #outputs the list of pairs [P,delta] such that P is a Laurent polynomial of low-degree -2, degree 2, and the coefficients #are positive integers between 1 and A, and the implied delta (using s sequence of length 2*K), in the Apery limit of the recurrence #satisfied by the constant term of P^n yields a positive delta, followed by a conjectured value (produced by #Maple, identified or own, if known. Try: #FindAZ2(x,3,300); FindAZ2:=proc(x,A,K) local L,a1,a2,a3,a4,a5,gu,P,mu: L:=[]: for a1 from 1 to A do for a2 from 1 to A do for a3 from 1 to A do for a4 from 1 to A do for a5 from 1 to A do P:=a1/x^2+a2/x+a3+a4*x+a5*x^2: gu:=DELaz(P,x,K): if gu<>FAIL then if gu[2]>0 then mu:=MyIDsLog(gu[1],20,1000): if mu=FAIL then mu:=identify(gu[1]): fi: L:=[op(L),[factor(P),mu,gu[2]]]: fi: fi: od: od: od: od: od: L: end: #FindZ1(A,n,k,K): Inputs a positive integer A and a large positive integer K #outputs the list of pairs [F,DEL(F,k,n,K)] such that F is an expression of the form binomial(n,k)*binomial(a1*n+b1*k,a2*n+b2*k)*x^k #where a1 is from 1 to A and b1 from 0 to A and a2<=a1 and b2<=b1 and x is between 1 and A #such that DEL(F,k,n,K)[2] is positive. Try: #FindZ1(1,n,k,300); FindZ1:=proc(A,n,k,K) local a1,a2,b1,b2,x,F,L,gu: L:=[]: for a1 from 1 to A do for a2 from 0 to A do for b1 from 1 to a1 do for b2 from 0 to a2 do if b1FAIL then if gu[2]>0 then L:= [op(L),[F,gu]]: fi: fi: od: fi: od: od: od: od: L: end: #FindZ2(A,n,k,K): Inputs a positive integer A and a large positive integer K #outputs the list of pairs [F,DEL(F,k,n,K)] such that F is an expression of the form binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k #where a1 is from 1 to A and b1 from 0 to A and a2<=a1 and b2<=b1 and x is between 1 and A #such that DEL(F,k,n,K)[2] is positive. Try: #FindZ2(1,n,k,300); FindZ2:=proc(A,n,k,K) local a1,a2,b1,b2,x,F,L,gu,Done1: L:=[]: Done1:={}: for a1 from 1 to A do for a2 from 1 to A do for b1 from 0 to A do for b2 from 0 to A do for x from 1 to A do F:=binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k: if not member(F,Done1) then Done1:=Done1 union {F}: gu:=DEL(F,k,n,K): if gu<>FAIL then if gu[2]>0 then L:= [op(L),[F,gu]]: fi: fi: fi: od: od: od: od: od: L: end: #DELazG(F,x,n,K): inputs a hyperexponential function F (cont. in x, discrete in n) in the cont. variable x and the discrete variable n #and outputs a(K)/b(K) where a(n),b(n) are solutions of the recurrence satisfied by the controur integral of F around the origin #with initial conditions [1,0,...0] and [0,1,...] respectively. It also gives you the estimated delta of the sequence. Try: #DELazG((1/x+1+x,x)^n/x,x,n,1000); DELazG:=proc(F,x,n,K) local N,ope,d,Ini1,Ini2,lu1,lu2,i,S,C,mu,mu1: ope:=OperAZd(F,x,n,N): d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[1,0$(d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0,1,0$(d-2)]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=d+1..2*K)]: C:=S[-1]: if C=0 then RETURN(FAIL): fi: mu:=evalf(C): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu:=identify(mu): else mu:=mu1: fi: mu,min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): end: #DELaz(P,x,K): inputs a Laurent polynoimal P in the cont. variable x and the discrete variable n #and outputs a(K)/b(K) where #b(n):=CT(P^n,x) and a(n) is satisfies the same initial conditions with a(i)=0 for negative i and 0 and a(1)=1, Try #DELaz(1/x+1+x,x,1000); DELaz:=proc(P,x,K) local n,N,ope,d,Ini1,Ini2,lu1,lu2,i,n1,S,C,mu,mu1: ope:=OperAZd(P^n/x,x,n,N): d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[seq(normal(P^n1),n1=0..d-1)]: Ini2:=[seq(coeff(series(Ini2[i],x=0),x,0), i=1..nops(Ini2))]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=1..2*K)]: C:=S[2*K]: mu:=evalf(C): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu:=identify(mu): else mu:=mu1: fi: mu,min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): end: #MyIDs(C,F,F0,N): Given a constant C in decimals and another constant #let's call it F, whose floating-point if F0 # and a positive integer N #tries to express C as (a*F+b)/(c*F+d) for a,b,c,d from -N to N using PSLQ #MyIDs(evalf((log(2)-2)/(2*log(2)+3)),log(2),evalf(log(2)),100); MyIDs:=proc(C,F,F0,N) local gu,mu,i: gu:=IntegerRelations[PSLQ]([1,evalf(C),evalf(F0),evalf(C*F0)]): if max(seq(abs(gu[i]),i=1..4)) >N then RETURN(FAIL): fi: mu:=-(gu[1]+gu[3]*F)/(gu[2]+gu[4]*F): if abs(evalf(subs(F=F0,mu)-C))>1/10^(Digits-7) then RETURN(FAIL): fi: mu: end: #MyIDsLog(C,K,N): guesses a fractional-linear expression for the constant C with coefficients <=N in aba. value (given in floating point) in terms of log(j/i) where 2<=iFAIL then RETURN(simplify(subs(F=log(i/j),gu))): fi: od: od: FAIL: end: #FindAZ1(x,A,K): Inputs a positive integer d, a variable x, a positive integer A and a large positive integer K #outputs the list of pairs [P,delta] such that P is a Laurent polynomial of low-degree -1, degree 1, and the coefficients #are positive integers between 1 and A, and the implied delta (using s sequence of length 2*K), in the Apery limit of the recurrence #satisfied by the constant term of P^n yields a positive delta, followed by a conjectured value (produced by #Maple, identified or own, if known. Try: #FindAZ1(x,3,300); FindAZ1:=proc(x,A,K) local L,a1,a2,a3,gu,P: L:=[]: for a1 from 1 to A do for a2 from 1 to A do for a3 from a1 to A do if igcd(a1,a2,a3)=1 then P:=a1/x+a2+a3*x: gu:=DELaz(P,x,K): if gu<>FAIL then if gu[2]>0 then L:=[op(L),[factor(P),gu]]: fi: fi: fi: od: od: od: L: end: #FindAZ2(x,A,K): Inputs a positive integer d, a variable x, a positive integer A and a large positive integer K #outputs the list of pairs [P,delta] such that P is a Laurent polynomial of low-degree -2, degree 2, and the coefficients #are positive integers between 1 and A, and the implied delta (using s sequence of length 2*K), in the Apery limit of the recurrence #satisfied by the constant term of P^n yields a positive delta, followed by a conjectured value (produced by #Maple, identified or own, if known. Try: #FindAZ2(x,3,300); FindAZ2:=proc(x,A,K) local L,a1,a2,a3,a4,a5,gu,P,mu: L:=[]: for a1 from 1 to A do for a2 from 1 to A do for a3 from 1 to A do for a4 from 1 to A do for a5 from 1 to A do P:=a1/x^2+a2/x+a3+a4*x+a5*x^2: gu:=DELaz(P,x,K): if gu<>FAIL then if gu[2]>0 then mu:=MyIDsLog(gu[1],20,1000): if mu=FAIL then mu:=identify(gu[1]): fi: L:=[op(L),[factor(P),mu,gu[2]]]: fi: fi: od: od: od: od: od: L: end: #DELazG(F,x,n,K): inputs a hyperexponential function F (cont. in x, discrete in n) in the cont. variable x and the discrete variable n #and outputs a(K)/b(K) where a(n),b(n) are solutions of the recurrence satisfied by the controur integral of F around the origin #with initial conditions [1,0,...0] and [0,1,...] respectively. It also gives you the estimated delta of the sequence. Try: #DELazG((1/x+1+x,x)^n/x,x,n,1000); DELazG:=proc(F,x,n,K) local N,ope,d,Ini1,Ini2,lu1,lu2,i,S,C,mu,mu1: ope:=OperAZd(F,x,n,N): d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[1,0$(d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0,1,0$(d-2)]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=d+1..2*K)]: C:=S[-1]: if C=0 then RETURN(FAIL): fi: mu:=evalf(C): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu:=identify(mu): else mu:=mu1: fi: mu,min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): end: #OpeMAZ1(a,b,c,n,N): The linear recurrence operator in n and the shift operator N satisfied by the constant term of In z, w) of #((1+z)*(1+w)*(a*w+b*z+c*w*z)/w/z)^n. In other words the output of #MAZ(1,1/z/w,(1+z)*(1+w)*(a*w+b*z+c*w*z)/w/z,[w,z],n,N,[a,b,c])[1]`): in the Maple package MAZ.txt. Try: #OpeMAZ1(1,1,1,n,N); OpeMAZ1:=proc(a,b,c,n,N) local ope,i: ope:= -(n+1)^2*(-c+b)*(a-c)*(a+b-c)^3*(27*a^2*b^2*n^2-288*a*b*c^2*n^2+256*a*c^3*n^2+256*b*c^3*n^2-256*c^4*n^2+171*a^2*b^2*n-24*a^2*b*c*n-24*a*b^2*c*n-1620*a*b*c^2*n+1472* a*c^3*n+1472*b*c^3*n-1472*c^4*n+252*a^2*b^2-66*a^2*b*c-66*a*b^2*c-2202*a*b*c^2+2052*a*c^3+2052*b*c^3-2052*c^4)/(n+4)^2/(27*a^2*b^2*n^2-288*a*b*c^2*n^2+256*a*c^3*n^2 +256*b*c^3*n^2-256*c^4*n^2+117*a^2*b^2*n-24*a^2*b*c*n-24*a*b^2*c*n-1044*a*b*c^2*n+960*a*c^3*n+960*b*c^3*n-960*c^4*n+108*a^2*b^2-42*a^2*b*c-42*a*b^2*c-870*a*b*c^2+ 836*a*c^3+836*b*c^3-836*c^4)/c+(81*a^5*b^3*n^4-108*a^5*b^2*c*n^4-567*a^4*b^4*n^4+486*a^4*b^3*c*n^4-756*a^4*b^2*c^2*n^4+1920*a^4*b*c^3*n^4-1024*a^4*c^4*n^4+81*a^3*b^ 5*n^4+486*a^3*b^4*c*n^4+5373*a^3*b^3*c^2*n^4-9684*a^3*b^2*c^3*n^4+1664*a^3*b*c^4*n^4+2048*a^3*c^5*n^4-108*a^2*b^5*c*n^4-756*a^2*b^4*c^2*n^4-9684*a^2*b^3*c^3*n^4+ 21684*a^2*b^2*c^4*n^4-11136*a^2*b*c^5*n^4+1920*a*b^4*c^3*n^4+1664*a*b^3*c^4*n^4-11136*a*b^2*c^5*n^4+9600*a*b*c^6*n^4-2048*a*c^7*n^4-1024*b^4*c^4*n^4+2048*b^3*c^5*n^ 4-2048*b*c^7*n^4+1024*c^8*n^4+756*a^5*b^3*n^3-1080*a^5*b^2*c*n^3+96*a^5*b*c^2*n^3-5292*a^4*b^4*n^3+4968*a^4*b^3*c*n^3-6780*a^4*b^2*c^2*n^3+16560*a^4*b*c^3*n^3-8960* a^4*c^4*n^3+756*a^3*b^5*n^3+4968*a^3*b^4*c*n^3+45000*a^3*b^3*c^2*n^3-83520*a^3*b^2*c^3*n^3+14608*a^3*b*c^4*n^3+17920*a^3*c^5*n^3-1080*a^2*b^5*c*n^3-6780*a^2*b^4*c^2 *n^3-83520*a^2*b^3*c^3*n^3+188580*a^2*b^2*c^4*n^3-97200*a^2*b*c^5*n^3+96*a*b^5*c^2*n^3+16560*a*b^4*c^3*n^3+14608*a*b^3*c^4*n^3-97200*a*b^2*c^5*n^3+83856*a*b*c^6*n^3 -17920*a*c^7*n^3-8960*b^4*c^4*n^3+17920*b^3*c^5*n^3-17920*b*c^7*n^3+8960*c^8*n^3+2466*a^5*b^3*n^2-3723*a^5*b^2*c*n^2+576*a^5*b*c^2*n^2-17343*a^4*b^4*n^2+17325*a^4*b ^3*c*n^2-21513*a^4*b^2*c^2*n^2+51120*a^4*b*c^3*n^2-28112*a^4*c^4*n^2+2466*a^3*b^5*n^2+17325*a^3*b^4*c*n^2+136542*a^3*b^3*c^2*n^2-260073*a^3*b^2*c^3*n^2+46720*a^3*b* c^4*n^2+56224*a^3*c^5*n^2-3723*a^2*b^5*c*n^2-21513*a^2*b^4*c^2*n^2-260073*a^2*b^3*c^3*n^2+590637*a^2*b^2*c^4*n^2-305328*a^2*b*c^5*n^2+576*a*b^5*c^2*n^2+51120*a*b^4* c^3*n^2+46720*a*b^3*c^4*n^2-305328*a*b^2*c^5*n^2+263136*a*b*c^6*n^2-56224*a*c^7*n^2-28112*b^4*c^4*n^2+56224*b^3*c^5*n^2-56224*b*c^7*n^2+28112*c^8*n^2+3357*a^5*b^3*n -5301*a^5*b^2*c*n+1092*a^5*b*c^2*n-23958*a^4*b^4*n+25065*a^4*b^3*c*n-28719*a^4*b^2*c^2*n+66984*a^4*b*c^3*n-37528*a^4*c^4*n+3357*a^3*b^5*n+25065*a^3*b^4*c*n+178401*a ^3*b^3*c^2*n-347967*a^3*b^2*c^3*n+65096*a^3*b*c^4*n+75056*a^3*c^5*n-5301*a^2*b^5*c*n-28719*a^2*b^4*c^2*n-347967*a^2*b^3*c^3*n+792555*a^2*b^2*c^4*n-410568*a^2*b*c^5* n+1092*a*b^5*c^2*n+66984*a*b^4*c^3*n+65096*a*b^3*c^4*n-410568*a*b^2*c^5*n+352452*a*b*c^6*n-75056*a*c^7*n-37528*b^4*c^4*n+75056*b^3*c^5*n-75056*b*c^7*n+37528*c^8*n+ 1620*a^5*b^3-2658*a^5*b^2*c+666*a^5*b*c^2-11880*a^4*b^4+12906*a^4*b^3*c-13662*a^4*b^2*c^2+31476*a^4*b*c^3-18036*a^4*c^4+1620*a^3*b^5+12906*a^3*b^4*c+84924*a^3*b^3*c ^2-169506*a^3*b^2*c^3+33552*a^3*b*c^4+36072*a^3*c^5-2658*a^2*b^5*c-13662*a^2*b^4*c^2-169506*a^2*b^3*c^3+386094*a^2*b^2*c^4-200268*a^2*b*c^5+666*a*b^5*c^2+31476*a*b^ 4*c^3+33552*a*b^3*c^4-200268*a*b^2*c^5+170646*a*b*c^6-36072*a*c^7-18036*b^4*c^4+36072*b^3*c^5-36072*b*c^7+18036*c^8)/(n+4)^2/(27*a^2*b^2*n^2-288*a*b*c^2*n^2+256*a*c ^3*n^2+256*b*c^3*n^2-256*c^4*n^2+117*a^2*b^2*n-24*a^2*b*c*n-24*a*b^2*c*n-1044*a*b*c^2*n+960*a*c^3*n+960*b*c^3*n-960*c^4*n+108*a^2*b^2-42*a^2*b*c-42*a*b^2*c-870*a*b* c^2+836*a*c^3+836*b*c^3-836*c^4)/c*N-(81*a^4*b^3*n^4-162*a^4*b^2*c*n^4+81*a^3*b^4*n^4+567*a^3*b^3*c*n^4-972*a^3*b^2*c^2*n^4+2496*a^3*b*c^3*n^4-1536*a^3*c^4*n^4-162* a^2*b^4*c*n^4-972*a^2*b^3*c^2*n^4-4674*a^2*b^2*c^3*n^4+4224*a^2*b*c^4*n^4+512*a^2*c^5*n^4+2496*a*b^3*c^3*n^4+4224*a*b^2*c^4*n^4-5696*a*b*c^5*n^4-512*a*c^6*n^4-1536* b^3*c^4*n^4+512*b^2*c^5*n^4-512*b*c^6*n^4+1536*c^7*n^4+837*a^4*b^3*n^3-1746*a^4*b^2*c*n^3+144*a^4*b*c^2*n^3+837*a^3*b^4*n^3+5715*a^3*b^3*c*n^3-9792*a^3*b^2*c^2*n^3+ 24216*a^3*b*c^3*n^3-14976*a^3*c^4*n^3-1746*a^2*b^4*c*n^3-9792*a^2*b^3*c^2*n^3-44718*a^2*b^2*c^3*n^3+41184*a^2*b*c^4*n^3+4992*a^2*c^5*n^3+144*a*b^4*c^2*n^3+24216*a*b ^3*c^3*n^3+41184*a*b^2*c^4*n^3-55752*a*b*c^5*n^3-4992*a*c^6*n^3-14976*b^3*c^4*n^3+4992*b^2*c^5*n^3-4992*b*c^6*n^3+14976*c^7*n^3+3096*a^4*b^3*n^2-6717*a^4*b^2*c*n^2+ 1044*a^4*b*c^2*n^2+3096*a^3*b^4*n^2+21054*a^3*b^3*c*n^2-36174*a^3*b^2*c^2*n^2+85356*a^3*b*c^3*n^2-53080*a^3*c^4*n^2-6717*a^2*b^4*c*n^2-36174*a^2*b^3*c^2*n^2-155325* a^2*b^2*c^3*n^2+146916*a^2*b*c^4*n^2+17352*a^2*c^5*n^2+1044*a*b^4*c^2*n^2+85356*a*b^3*c^3*n^2+146916*a*b^2*c^4*n^2-199836*a*b*c^5*n^2-17352*a*c^6*n^2-53080*b^3*c^4* n^2+17352*b^2*c^5*n^2-17352*b*c^6*n^2+53080*c^7*n^2+4842*a^4*b^3*n-10893*a^4*b^2*c*n+2436*a^4*b*c^2*n+4842*a^3*b^4*n+33312*a^3*b^3*c*n-57762*a^3*b^2*c^2*n+128760*a^ 3*b*c^3*n-80632*a^3*c^4*n-10893*a^2*b^4*c*n-57762*a^2*b^3*c^2*n-230817*a^2*b^2*c^3*n+226476*a^2*b*c^4*n+25256*a^2*c^5*n+2436*a*b^4*c^2*n+128760*a*b^3*c^3*n+226476*a *b^2*c^4*n-309776*a*b*c^5*n-25256*a*c^6*n-80632*b^3*c^4*n+25256*b^2*c^5*n-25256*b*c^6*n+80632*c^7*n+2664*a^4*b^3-6192*a^4*b^2*c+1806*a^4*b*c^2+2664*a^3*b^4+18792*a^ 3*b^3*c-33270*a^3*b^2*c^2+69282*a^3*b*c^3-43836*a^3*c^4-6192*a^2*b^4*c-33270*a^2*b^3*c^2-122556*a^2*b^2*c^3+126510*a^2*b*c^4+12708*a^2*c^5+1806*a*b^4*c^2+69282*a*b^ 3*c^3+126510*a*b^2*c^4-174090*a*b*c^5-12708*a*c^6-43836*b^3*c^4+12708*b^2*c^5-12708*b*c^6+43836*c^7)/(n+4)^2/(27*a^2*b^2*n^2-288*a*b*c^2*n^2+256*a*c^3*n^2+256*b*c^3 *n^2-256*c^4*n^2+117*a^2*b^2*n-24*a^2*b*c*n-24*a*b^2*c*n-1044*a*b*c^2*n+960*a*c^3*n+960*b*c^3*n-960*c^4*n+108*a^2*b^2-42*a^2*b*c-42*a*b^2*c-870*a*b*c^2+836*a*c^3+ 836*b*c^3-836*c^4)/c*N^2+(27*a^3*b^3*n^4-108*a^3*b^2*c*n^4-108*a^2*b^3*c*n^4-396*a^2*b^2*c^2*n^4+1408*a^2*b*c^3*n^4-1024*a^2*c^4*n^4+1408*a*b^2*c^3*n^4-1152*a*b*c^4 *n^4-1024*b^2*c^4*n^4+1024*c^6*n^4+306*a^3*b^3*n^3-1248*a^3*b^2*c*n^3+96*a^3*b*c^2*n^3-1248*a^2*b^3*c*n^3-4092*a^2*b^2*c^2*n^3+15088*a^2*b*c^3*n^3-11008*a^2*c^4*n^3 +96*a*b^3*c^2*n^3+15088*a*b^2*c^3*n^3-12528*a*b*c^4*n^3-11008*b^2*c^4*n^3+11008*c^6*n^3+1251*a^3*b^3*n^2-5205*a^3*b^2*c*n^2+816*a^3*b*c^2*n^2-5205*a^2*b^3*c*n^2-\ 15285*a^2*b^2*c^2*n^2+58592*a^2*b*c^3*n^2-42832*a^2*c^4*n^2+816*a*b^3*c^2*n^2+58592*a*b^2*c^3*n^2-49600*a*b*c^4*n^2-42832*b^2*c^4*n^2+42832*c^6*n^2+2160*a^3*b^3*n-\ 9159*a^3*b^2*c*n+2220*a^3*b*c^2*n-9159*a^2*b^3*c*n-24051*a^2*b^2*c^2*n+96608*a^2*b*c^3*n-70728*a^2*c^4*n+2220*a*b^3*c^2*n+96608*a*b^2*c^3*n-83924*a*b*c^4*n-70728*b^ 2*c^4*n+70728*c^6*n+1296*a^3*b^3-5580*a^3*b^2*c+1878*a^3*b*c^2-5580*a^2*b^3*c-13056*a^2*b^2*c^2+56124*a^2*b*c^3-41228*a^2*c^4+1878*a*b^3*c^2+56124*a*b^2*c^3-50506*a *b*c^4-41228*b^2*c^4+41228*c^6)/(n+4)^2/(27*a^2*b^2*n^2-288*a*b*c^2*n^2+256*a*c^3*n^2+256*b*c^3*n^2-256*c^4*n^2+117*a^2*b^2*n-24*a^2*b*c*n-24*a*b^2*c*n-1044*a*b*c^2 *n+960*a*c^3*n+960*b*c^3*n-960*c^4*n+108*a^2*b^2-42*a^2*b*c-42*a*b^2*c-870*a*b*c^2+836*a*c^3+836*b*c^3-836*c^4)/c*N^3+N^4 : ope:=expand(subs(n=n-degree(ope,N),ope)/N^degree(ope,N)): ope:=1-expand(ope/coeff(ope,N,0)): add(factor(coeff(ope,N,-i))*N^(-i),i=1..-ldegree(ope,N)): end: with(IntegerRelations): # GEk(k, a, x): Guess a degree k polynomial in x that # c = DELazG(((1 + a * x) * (1 + (a + 1) * x) / x)^n / x^(1 / k), x, n, 1000)[1]: # seems to satisfy. # Returns [p, p(c)]. # Try: # GEk(2, 2, x); # GEk(3, 3, x); GEk := proc(k, a, x) option remember: local L, c, i, p, j: c := DELazG(((1 + a * x) * (1 + (a + 1) * x) / x)^n / x^((k - 1) / k), x, n, 1000)[1]: L := PSLQ([seq(c^j, j=0..k)]): p := add(L[i] * x^(i - 1), i=1..nops(L)): [p, evalf(subs(x=c, p))]: end: # GEkCoeff(k, j, N): Return the coefficients on x^j for the polynomials GEk(k, # a, x) for a = 1, 2, ..., N. GEkCoeff := proc(k, j, N) local a,x: [seq(coeff(GEk(k, a, x)[1], x, j), a=1..N)]: end: # guessPol: Given a list L, guess a polynomial of minimal that generates it in # the symbol a. guessPol := proc(L, a) local c, deg, p, eqns, soln, pG, k, i: for deg from 0 to nops(L) - 1 do p := add(c[k] * a^k, k=0..deg): eqns := {seq(L[i] - subs(a=i, p), i=1..deg + 1)}: soln := solve(eqns, {seq(c[i], i=0..deg)}): if soln <> NULL then pG := subs(soln, p): if andmap(i -> subs(a = i, pG) = L[i], [seq(1..nops(L))]) then return factor(pG): fi: fi: end: FAIL: end: # guessGEk(k, j, N): Guess a polynomial expression in a for the # coefficients of GEk(k, a, x). guessGEk := proc(k, a, N) local j: [seq(guessPol(GEkCoeff(k, j, N), a), j=0..k)]: end: #START Story procedure #DELv(F,k,n,K): verbose form of DEL(F,k,n,K). DELv:=proc(F,k,n,K) local ope,N,d,Ini1,Ini2,lu1,lu2,k1,n1,i,C,S,mu,mu1,b,a,delt,t0: t0:=time(): print(``): print(`-------------------------------------------------------------`): print(``): print(`The Apery limit generated by the binomial coefficient sum`, Sum(F,k)): print(``): print(`By Shalosh B. Ekhad `): print(``): ope:=OperZeil(F,k,n,N)[1]: print(`Let `): print(``): print(b(n)=Sum(F,k) ): print(``): print(`The famous Zeilberger algorithm finds (and proves!, but proof omitted) that `, b(n), `sastisfies the following linear recurrence with polynomial coefficients`): print(``): print(b(n)=add(coeff(ope,N,-i)*b(n-i),i=1..-ldegree(ope,N))): print(``): print(`and in Maple notation`): print(``): lprint(b(n)=add(coeff(ope,N,-i)*b(n-i),i=1..-ldegree(ope,N))): print(``): d:=-ldegree(ope,N): if K<100 then print(K, `must be at least 100`): RETURN(FAIL): fi: if d<2 then print(`The recurrence has order less than 2, so we can't do anything.`): RETURN(FAIL): fi: Ini2:=[seq(add(eval(subs({n=n1,k=k1},F)),k1=0..n1),n1=0..d-1)]: print(`Of course, the initial conditions are`): print(seq(b(n1-1)=Ini2[n1],n1=1..d)): print(``): lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: print(`Let's consider the related sequence, let's call it`, a(n) ): print(``): print(`satisying the same recurrence, i.e.`): print(``): print(a(n)=add(coeff(ope,N,-i)*a(n-i),i=1..-ldegree(ope,N))): print(``): print(`but with the following simpler initial conditions`): print(``): print(seq(a(n1-1)=Ini1[n1],n1=1..d)): lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then print(`Something went wrong`): RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=1..2*K)]: C:=S[2*K]: print(`Using the recurrence, we can compute many terms, how about`, 2*K, `terms for each sequence and get a very good approximation to the Apery limit, i.e. the limit of`, a(n)/b(n), `as n goes to infinity`): mu:=evalf(C): print(`that is approximately `): print(``): print(mu): print(``): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu1:=identify(mu): fi: if mu1<>mu then print(`This constant is identified as`, mu1): print(``): fi: delt:=min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): print(`The implied delta is`, delt): print(``): if delt>0 then print(``): print(`Since this is positive, this suggests an Apery-style irrationality proof of`, mu1): else print(`Since this is negative, there is no Apery-style irrationality proof of`, mu1, `but still a very fast way to compute it to many digits`): fi: print(``): print(`-----------------------`): print(``): print(`This took`, time()-t0, `seconds. `): mu,delt: end: #DELsipur1(A,B,k,n,K): outputs an article for DEL(F,k,n,K) for all F of the form binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k, for 1<=a1,a2<=A, 0<=b1,b2<=A, 1<=x<=B, try: #DELsipur1(1,1,k,n,1000) DELsipur1:=proc(A,B,k,n,K) local F,t0,a1,a2,b1,b2,x: t0:=time(): print(`The Apery Limits for all summands of the form`, binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k, `for a1 and a2 from 1 to`, A, `and b1 and b2 from 0 to`, A, `and x from to`, B): print(``): print(`By Shalosh B. Ekhad `): print(``): for a1 from 1 to A do for a2 from 1 to A do for b1 from 0 to A do for b2 from 0 to A do for x from 1 to B do F:= binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*x^k: DELv(F,k,n,K): od: od: od: od: od: print(`----------------------------------`): print(``): print(`This ends this book that took altogether`, time()-t0, `seconds to produce. `): end: #DELsipur2(A,B,k,n,K): outputs an article for DEL(F,k,n,K) for all F of the form binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*)*binomial(a3*n+b3*k,k)x^k, for 1<=a1,a2,a3<=A, 0<=b1,b2,b32<=A, 1<=x<=B, try: #DELsipur2(1,1,k,n,1000) DELsipur2:=proc(A,B,k,n,K) local F,t0,a1,a2,a3,b1,b2,b3,x: t0:=time(): print(`The Apery Limits for all summands of the form`, binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*binomial(a3*n+b3*k,k)*x^k, `for a1, a2 and a3from 1 to`, A, `and b1,b2 and b3 from 0 to`, A, `and x from to`, B): print(``): print(`By Shalosh B. Ekhad `): print(``): for a1 from 1 to A do for a2 from 1 to A do for a3 from 1 to A do for b1 from 0 to A do for b2 from 0 to A do for b3 from 0 to A do for x from 1 to B do F:= binomial(n,k)*binomial(a1*n+b1*k,k)*binomial(a2*n+b2*k,k)*binomial(a3*n+b3*k,k)*x^k: DELv(F,k,n,K): od: od: od: od: od: od: od: print(`----------------------------------`): print(``): print(`This ends this book that took altogether`, time()-t0, `seconds to produce. `): end: #DELsipur3(n,k,K): outputs an article for DEL(F,k,n,K) for all F in the pre-computed OutF1(n,k). Try: #DELsipur3(n,k,K) DELsipur3:=proc(n,k,K) local gu,i,t0: t0:=time(): gu:=OutF1(n,k): print(`The Apery Limits for various summands that yield potential irrationality proofs`): print(``): print(`By Shalosh B. Ekhad `): print(``): for i from 1 to nops(gu) do DELv(gu[i][1],k,n,K): od: print(``): print(`-------------------------------`): print(``): print(`the whole thing took`, time()-t0, `seconds. `): end: #DELazV(P,x,K): a verbose form of DELaz(P,x,K) (q.v.) #DELazV(1/x+1+x,x,1000); DELazV:=proc(P,x,K) local n,N,ope,d,Ini1,Ini2,lu1,lu2,i,n1,S,C,mu,mu1,t0,delt: t0:=time(): print(``): print(`-------------------------------------------------------------`): print(``): print(`The Apery limit generated by the sequence that are constant terms in x of`, P^n): print(``): print(`By Shalosh B. Ekhad `): print(``): ope:=OperAZd(P^n/x,x,n,N): d:=-ldegree(ope,N): if d<2 then print(`The operator has order less than 2, so nothing an be done`): RETURN(FAIL): fi: print(`Let `, b(n), `be the coefficient of x^0 (i.e. constant term of`, P^n): print(``): print(`The famous Almkvist-Zeilberger algorithm finds (and proves!, but proof omitted) that `, b(n), `sastisfies the following linear recurrence with polynomial coefficients`): print(``): print(b(n)=add(coeff(ope,N,-i)*b(n-i),i=1..-ldegree(ope,N))): print(``): print(`and in Maple notation`): print(``): lprint(b(n)=add(coeff(ope,N,-i)*b(n-i),i=1..-ldegree(ope,N))): print(``): Ini2:=[seq(coeff(P^n1,x,0),n1=0..d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then print(`Something went wrong`): RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: print(`Let's consider the related sequence, let's call it`, a(n) ): print(``): print(`satisying the same recurrence, i.e.`): print(``): print(a(n)=add(coeff(ope,N,-i)*a(n-i),i=1..-ldegree(ope,N))): print(``): print(`but with the following simpler initial conditions`): print(``): print(seq(a(n1-1)=Ini1[n1],n1=1..d)): lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then print(`Something went wrong`): RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=1..2*K)]: C:=S[2*K]: mu:=evalf(C): print(`Using the recurrence, we can compute many terms, how about`, 2*K, `terms for each sequence and get a very good approximation to the Apery limit, i.e. the limit of`, a(n)/b(n), `as n goes to infinity`): print(`that is approximately `): print(``): print(mu): print(``): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu1:=identify(mu): fi: if mu1<>mu then print(`This constant is identified as`, mu1): print(``): fi: delt:=min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): print(`The implied delta is`, delt): print(``): if delt>0 then print(``): print(`Since this is positive, this suggests an Apery-style irrationality proof of`, mu1): else print(`Since this is negative, there is no Apery-style irrationality proof of`, mu1, `but still a very fast way to compute it to many digits`): fi: print(``): print(`-----------------------`): print(``): print(`This took`, time()-t0, `seconds. `): mu,delt: end: #DELazSipur(x,K): outputs an article with the DELazV(P,x,K) for P in OutAZ1(x), giving positive deltas. Try: #DELazSipur(x,1000): DELazSipur:=proc(x,K) local gu,i,t0: gu:=OutAZ1(x): t0:=time(): for i from 1 to nops(gu) do DELazV(gu[i][1],x,K): od: print(``): print(`------------------------------`): print(``): print(`The whole thing took`, time()-t0, `seconds. `): print(``): end: #DELazGv(F,x,n,K): a verbose form of DELazG(F,x,n,K) (q.v.) #DELazGv(1/x+1+x,x,1000); DELazGv:=proc(F,x,n,K) local a,b,N,ope,d,Ini1,Ini2,lu1,lu2,i,n1,S,C,mu,mu1,t0,delt: t0:=time(): print(``): print(`-------------------------------------------------------------`): print(``): print(`The Apery limit generated by the sequences that satisfy the recurrence for the contour integral x of`, F): print(``): print(`By Shalosh B. Ekhad `): print(``): ope:=OperAZd(F,x,n,N): d:=-ldegree(ope,N): if d<2 then print(`The operator has order less than 2, so nothing an be done`): RETURN(FAIL): fi: print(`Let `, a(n), b(n), `be the sequences satisfying the same recurrence satisfied by the contour integral around x=0 of`): print(``): print(F): print(``): print(`produced by the famous Almkvist-Zeilberger algorithm namely`): print(``): print(a(n)=add(coeff(ope,N,-i)*a(n-i),i=1..-ldegree(ope,N))): print(``): print(b(n)=add(coeff(ope,N,-i)*b(n-i),i=1..-ldegree(ope,N))): print(``): print(`and in Maple notation`): print(``): lprint(b(n)=add(coeff(ope,N,-i)*b(n-i),i=1..-ldegree(ope,N))): print(``): lprint(a(n)=add(coeff(ope,N,-i)*a(n-i),i=1..-ldegree(ope,N))): print(``): Ini2:=[1,0$(d-1)]: Ini1:=[0,1,0$(d-2)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then print(`Something went wrong`): RETURN(FAIL): fi: Ini1:=[0$(d-2),0,1]: #KAKI print(`with initial conditions `): print(``): print(seq(a(n1-1)=Ini1[n1],n1=1..d)): print(``): print(``): print(seq(b(n1-1)=Ini2[n1],n1=1..d)): print(``): lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then print(`Something went wrong`): RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=d+1..2*K)]: C:=S[-1]: mu:=evalf(C): print(`Using the recurrence, we can compute many terms, how about`, 2*K, `terms for each sequence and get a very good approximation to the Apery limit, i.e. the limit of`, a(n)/b(n), `as n goes to infinity`): print(`that is approximately `): print(``): print(mu): print(``): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu1:=identify(mu): fi: if mu1<>mu then print(`This constant is identified as`, mu1): print(``): fi: delt:=min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): print(`The implied delta is`, delt): print(``): if delt>0 then print(``): print(`Since this is positive, this suggests an Apery-style irrationality proof of`, mu1): else print(`Since this is negative, there is no Apery-style irrationality proof of`, mu1, `but still a very fast way to compute it to many digits`): fi: print(``): print(`-----------------------`): print(``): print(`This took`, time()-t0, `seconds. `): mu,delt: end: #CubicStory(c): An article about conjectured fast approximations to the root of 64+144*x*(1+2*a)+108*x^2*(3*a^2+3*a+1)+27*x^3*(1+2*a)=0. Try: #CubicStory(c): CubicStory:=proc(c) local x,ope,F,X,n,i,N,c0: print(``): print(`---------------------------------------`): print(``): print(`A conjectured good rational approximations to the cubic irrationality of`, 64+144*x*(1+2*c)+108*x^2*(3*c^2+3*c+1)+27*x^3*(1+2*c)=0, `for positive intgers c, with amazing irrationality measures as a gets bigger`): print(``): print(`By Shalosh B. Ekhad `): print(``): print(`Consider the real root of the cubic equation (with a positive)`): print(``): print( 64+144*x*(1+2*c)+108*x^2*(3*c^2+3*c+1)+27*x^3*(1+2*c)=0): print(``): print(`that according to Cardano equals`): print(``): print(solve(64+144*x*(1+2*c)+108*x^2*(3*c^2+3*c+1)+27*x^3*(1+2*c),x)[1]): print(``): print(`Consider the recurrence satisfied by the contour-integral, around x=0, of the function`): print(``): print(((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/3)): print(``): print(`let's call it X(n)`): print(``): print(`that in Maple notation is`): print(``): F:=((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/3): lprint(F): print(``): print(`According to the famous Almkvist-Zeilberger algorithm, it satisfies the recurrence`): print(``): ope:=OperAZd(F,x,n,N): print(``): lprint(X(n)=add(coeff(ope,N,-i)*X(n-i),i=1..-ldegree(ope,N))): print(``): print(`Let a(n), b(n), be the sequence that satisfy that recurrence with`): print(``): print(`with the initial conditions `): print(``): print(a(0)=0,a(1)=1): print(``): print(b(0)=1,b(1)=0): print(``): print(`We conjecture that the limit of a(n)/b(n) as n goes to infinity is the above-mentioned cubic irrationality, namely the real root of`): print(``): print( 64+144*x*(1+2*c)+108*x^2*(3*c^2+3*c+1)+27*x^3*(1+2*c)=0): print(``): print(`Not only that, these seem to give effective irrationality measures, that starting with c=4 are better than Liouville's irratioanlity measure of 3`): print(``): print(`The estimated irrationality measure for the case c=4 is`): print(``): print(1+1/DELazG( subs(c=4,((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/3)),x,n,1000)[2]): print(``): print(`Let's make c bigger and see how the effective irrationaliy measure shrinks`): print(``): for i from 1 to 5 do c0:=10^i+1: print(`For c=`, c0, `the irrationality measure is estimated to be`): print(``): print(1+1/DELazG( subs(c=c0,((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/3)),x,n,1000)[2]): od: print(``): print(`as you can see, it seems to go down to 2`): print(``): end: #DELmaz(a,b,c,K): inputs positive integers a,b,c, and outputs the Apery limit for the operaor OpeMAZ1(a,b,c,n,N) (q.v.( wuth initial conditions a(1)=1 and the rest 0, b(0)=1 and the rest 0. Try: #DELmaz(1,1,1,1000); DELmaz:=proc(a,b,c,K) local n,N,ope,d,Ini1,Ini2,lu1,lu2,i,S,C,mu,mu1: ope:=OpeMAZ1(a,b,c,n,N): d:=-ldegree(ope,N): if d<2 then RETURN(FAIL): fi: Ini2:=[1,0$(d-1)]: lu2:=SeqFromRec(ope,n,N,Ini2,0,2*K): if lu2=FAIL then RETURN(FAIL): fi: Ini1:=[0,1,0$(d-2)]: lu1:=SeqFromRec(ope,n,N,Ini1,2-d,2*K): if lu1=FAIL then RETURN(FAIL): fi: S:=[seq(lu1[i]/lu2[i],i=d+1..2*K)]: C:=S[-1]: if C=0 then RETURN(FAIL): fi: mu:=evalf(C): mu1:=MyIDsLog(mu,30,10000): if mu1=FAIL then mu:=identify(mu): else mu:=mu1: fi: mu,min(seq(evalf(-log(abs(C-S[i]))/log(denom(S[i])))-1,i=K..K+10)): end: #FindMAZ(A,K): Inputs a positive integer A and a large positive integer K #outputs the list of pairs [[a,b,c],DELmaz(a,b,c,K)] such that DELmaz(a,b,c,K)[2] is positive #for all 1<=a,b,c,<=A. Try #FindMAZ(1,1000); FindMAZ:=proc(A,K) local L,a,b,c,gu: L:=[]: for a from 1 to A do for b from 1 to A do for c from 1 to A do if igcd(a,b,c)=1 then gu:=DELmaz(a,b,c,K): if gu<>FAIL then if gu[2]>0 then L:= [op(L),[[a,b,c],gu]]: fi: fi: fi: od: od: od: L: end: #QuadStory(c): An article about conjectured fast approximations to the root of -3*c-3/2-3*(c^2+c)^(1/2) #QuadStory(c): QuadStory:=proc(c) local x,ope,F,X,n,i,N,c0: print(``): print(`---------------------------------------`): print(``): print(`A conjectured good rational approximations to `, -3*c-3/2-3*(c^2+c^(1/2)), `for positive intgers c,as good as from the continued fraction`): print(``): print(`By Shalosh B. Ekhad `): print(``): print(`Regarding the constant`, -3*c-3/2-3*(c^2+c)^(1/2) ): print(): print(``): print(`Consider the recurrence satisfied by the contour-integral, around x=0, of the function`): print(``): print(((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/2)): print(``): print(`let's call it X(n)`): print(``): print(`that in Maple notation is`): print(``): F:=((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/2): lprint(F): print(``): print(`According to the famous Almkvist-Zeilberger algorithm, it satisfies the recurrence`): print(``): ope:=OperAZd(F,x,n,N): print(``): lprint(X(n)=add(coeff(ope,N,-i)*X(n-i),i=1..-ldegree(ope,N))): print(``): print(`Let a(n), b(n), be the sequence that satisfy that recurrence with`): print(``): print(`with the initial conditions `): print(``): print(a(0)=0,a(1)=1): print(``): print(b(0)=1,b(1)=0): print(``): print(`We conjecture that the limit of a(n)/b(n) as n goes to infinity is the above-mentioned`, -3*c-3/2-3*(c^2+c)^(1/2)): print(``): print(`Not only that, these seem to give irrationality measure 2, just like the one coming from the continued fraction.`): print(``): print(`The estimated irrationality measure for the case c=4 is`): print(``): print(1+1/DELazG( subs(c=4,((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/2)),x,n,1000)[2]): print(``): print(`Let's make c bigger and see how the effective irrationaliy measure shrinks`): print(``): for i from 1 to 5 do c0:=10^i+1: print(`For c=`, c0, `the irrationality measure is estimated to be`): print(``): print(1+1/DELazG( subs(c=c0,((1+c*x)*(1+(c+1)*x)/x)^n/x*x^(1/2)),x,n,1000)[2]): od: print(``): print(`as you can see, it seems to go down to 2`): print(``): end: