###################################################################### ## BCMV.txt Save this file as BCMV.txt to use it, # # stay in the # ## same directory, get into Maple (by typing: maple ) # ## and then type: read BCMV.txt # ## Then follow the instructions given there # ## # ## Written by Doron Zeilberger, Rutgers University , # ## DoronZeil at gmail dot com # ###################################################################### print(`First Written: Feb. 15, 2024: tested for Maple 2020 `): print(`Version : Feb. 28, 2024; Adding fascinating code by Mark van Hoeij `): print(): print(`This is BCMV.txt, A Maple package`): print(`accompanying Shalosh B. Ekhad and Doron Zeilberger's article: `): print(` Efficient Evaluations of Weighted Sums over the Boolean Lattice inspired by conjectures of Berti, Corsi, Maspero, and Ventura `): print(` http://sites.math.rutgers.edu/~zeilberg/tokhniot/mamarim/mamarimhtml/bcmv.html `): print(): print(`The most current version is available on WWW at:`): print(` http://sites.math.rutgers.edu/~zeilberg/tokhniot/BCMV.txt .`): print(`Please report all bugs to: DoronZeil at gmail dot com .`): print(): print(`For general help, and a list of the MAIN functions,`): print(` type "ezra();". For specific help type "ezra(procedure_name);" `): print(`For a list of the supporting functions type: ezra1();`): print(): print(`For the general procedure, type, ezraG();`): print(` type "ezra();". For specific help type "ezra(procedure_name);" `): print(`For a list of the supporting functions type: ezra1();`): print(): ezra1:=proc() if args=NULL then print(`The SUPPORTING procedures are: IV1, IV, IVn, gpJ, npJ `): print(``): else ezra(args): fi: end: ezra:=proc() if args=NULL then print(` BCMV.txt: A Maple package for investigating a conjectured combinatoiral identity that came up in deep water`): print(`The MAIN procedures are: A, Ax, AxR, AxC, C, Cx, CxR, CxH, Bx, BxC, BxR, Dx, DxH, DxR `): print(` MvHK, K, ProveConjAx, ProveConjBx, VerifyConjC `): print(``): elif nargs=1 and args[1]=A then print(`A(p): The left side of eq. (3) in the BMV question (as stated). Try: `): print(`A(10);`): elif nargs=1 and args[1]=Ax then print(`Ax(p,x)The left side of eq. (3) in the BMV question where p is replaced by the symbol x. Try:`): print(`Ax(10,x);`): elif nargs=1 and args[1]=AxC then print(`AxC(p,x)The Conjectured Am3x(p,x); Try:`): print(`AxC(p,x);`): elif nargs=1 and args[1]=AxR then print(`AxR(p,x): Ax(p,x) done recursively, rather than directly, via BxR(p,x) (q.v.) . Try:`): print(`AxR(10,x);`): elif nargs=1 and args[1]=C then print(`C(p): The left side of eq. (4) in Alberto Maspero's question. Try:`): print(`C(10);`): elif nargs=1 and args[1]=Cx then print(`Cx(p,x): The left side of eq. (4) in Alberto Maspero's question with p replaced by a symbol x, done directly. Try`): print(`[seq(Cx(p,x),p=2..10)];`): elif nargs=1 and args[1]=CxR then print(`CxR(p,x): The left side of eq. (4) in Alberto Maspero's question with p replaced by a symbol x, done recusively. Same as Cx(p,x) but much faster. `): print(`[seq(CxR(p,x),p=2..10)];`): elif nargs=1 and args[1]=CxH then print(`CxH(p,x): same as CxR(p,x), but faster, using the second-order recurrence `): print(`[seq(CxH(p,x),p=2..10)];`): elif nargs=1 and args[1]=Bx then print(`Bx(p,x): The weight-enumerator (according to npJ(x,L)) of IV(p), done directly. Try:`): print(`Bx(10,x);`): elif nargs=1 and args[1]=Dx then print(`Dx(p,x): The weight-enumerator (according to npJ(x,L)*gpJ(x,L)) of IV(p), done directly. Try:`): print(`[seq(Dx(i,x),i=1..20)];`): elif nargs=1 and args[1]=DxH then print(`DxH(p,x): The weight-enumerator (according to npJ(x,L)*gpJ(x,L)) of IV(p), via the second-order linear recurrence. Same output as Dx(p,x) and DxR(p,x), and even faster than the latter. Try:`): print(`[seq(DxH(i,x),i=1..20)];`): elif nargs=1 and args[1]=DxR then print(`DxR(p,x): The weight-enumerator (according to npJ(x,L)*gpJ(x,L)) of IV(p), done recursively. Same output as Dx(p,x) but much faster. Try:`): print(`[seq(DxR(i,x),i=1..20)];`): elif nargs=1 and args[1]=BxC then print(`BxC(p,x): The Conjectured expression for Bx(p,x) Try:`): print(`BxC(10,x);`): elif nargs=1 and args[1]=BxR then print(`BxR(p,x): Bx(p,x) done recursivley (hence much faster). Try:`): print(`BxR(10,x);`): elif nargs=1 and args[1]=IV then print(`IV(p): The set of all increasing vectors of positive integers that end in p. Try:`): print(`IV(6); `): elif nargs=1 and args[1]=IV1 then print(`IV1(p,q): The set of all increasing vectors of length q that end in p. Try:`): print(`IV1(6,3);`): elif nargs=1 and args[1]=IVn then print(`IVn(p): The set of all increasing vectors that end in

=d+2 GP1:=proc(L,n,d) local a,i,P,eq,var: if nops(L){0} then RETURN(FAIL): fi: P: end: #GP(L,n): Inputs a list of numbers L and a variable n and outputs the polynomial of degree <=nops(L)-2 #P(n), such that P(i)=L[i], for all i from 1 to nops(L). OR FAIL #nops(L)>=d+2 GP:=proc(L,n) local d,P: for d from 0 to nops(L)-2 do P:=GP1(L,n,d): if P<>FAIL then RETURN(P): fi: od: FAIL: end: #End From GuessPol #npJOld(p,J):inputs an increasing list of pos. integers J and an integr (or symbol p) outputs n_q^(p)(J) in Alberto Maspero's identity. Try: #npJOld(11,[3,6,8]); npJOld:=proc(p,J) local q,i: q:=nops(J): factor((-12)^q*convert(J,`*`)*J[1]*mul(J[i+1]-J[i],i=1..q-1)*(p-J[q])/mul(p^3-p+J[i]-J[i]^3,i=1..q)): end: #npJ(x,J):inputs an increasing list of pos. integers J and an integer (or symbol p) outputs n_q^(p)(J) in the BMV identity. Try: #npJ(11,[3,6,8]); npJ:=proc(x,J) local q,J1: option remember: q:=nops(J): if q=1 then RETURN(-12*J[1]^2*(x-J[1])/(x^3-x+J[1]-J[1]^3)): fi: J1:=[op(1..q-1,J)]: factor(normal(npJ(x,J1)*(-12)*J[q]*(J[q]-J[q-1])*(x-J[q])/(x-J[q-1])/(x^3-x+J[q]-J[q]^3))): end: #gpJ(x,J):inputs an increasing list of pos. integers J and an integr (or symbol p) outputs g_q^(p)(J) in Alberto Maspero's identity. Try: #gpJ(11,[3,6,8]); gpJ:=proc(x,J) local q: q:=nops(J): if q=1 then RETURN(-28/9*x^2+29/45+274/45*J[1]^2-1/6*(x^3-x)/J[1]+1/5*(x^3-x)*(x+J[1])/(x^2+x*J[1]+J[1]^2-1)-13/9*x*J[1]): fi: gpJ(x,[op(1..q-1,J)])+ 5/18*(x^3-x)*1/J[q]+ 38/15*J[q]^2+ (x^3-x)/5*(x+J[q])/(x^2+J[q]^2+x*J[q]-1) -13/9*J[q-1]*J[q] -13/9*(J[q]-J[q-1])*x +49/45 end: #gpJOld(p,J):inputs an increasing list of pos. integers J and an integr (or symbol p) outputs g_q^(p)(J) in Alberto Maspero's identity. Try: #gpJOld(11,[3,6,8]); gpJOld:=proc(x,J) local q,i: q:=nops(J): -28/9*x^2+49/45*q+32/9*J[1]^2-4/9-4/9*(x^3-x)/J[1]+ 5/18*(x^3-x)*add(1/J[i],i=1..q)+ 38/15*add(J[i]^2,i=1..q)+ (x^3-x)/5* add((x+J[i])/(x^2+J[i]^2+x*J[i]-1),i=1..q)-13/9*(add(J[i]*J[i+1],i=1..q-1)+J[q]*x): end: #IV1(p,q): The set of all increasing vectors of length q that end in p. Try: #IV1(6,3); IV1:=proc(p,q) local gu,gu1,p1: option remember: if q=1 then RETURN({[p]}): fi: gu:= {seq(op(IV1(p1,q-1)),p1=1..p-1)}: gu:={seq([op(gu1),p],gu1 in gu)}: gu: end: #IV(p): The set of all increasing vectors of positive integers that end in p. Try: #IV(6); IV:=proc(p) local q: {seq(op(IV1(p,q)),q=1..p)}: end: #IVn(p): The set of all increasing vectors that end in

=d+2 GP1:=proc(L,n,d) local a,i,P,eq,var: if nops(L){0} then RETURN(FAIL): fi: P: end: #GP(L,n): Inputs a list of numbers L and a variable n and outputs the polynomial of degree <=nops(L)-2 #P(n), such that P(i)=L[i], for all i from 1 to nops(L). OR FAIL #nops(L)>=d+2 GP:=proc(L,n) local d,P: for d from 0 to nops(L)-2 do P:=GP1(L,n,d): if P<>FAIL then RETURN(P): fi: od: FAIL: end: #End From GuessPol #npJOld(p,J):inputs an increasing list of pos. integers J and an integr (or symbol p) outputs n_q^(p)(J) in Alberto Maspero's identity. Try: #npJOld(11,[3,6,8]); npJOld:=proc(p,J) local q,i: q:=nops(J): factor((-12)^q*convert(J,`*`)*J[1]*mul(J[i+1]-J[i],i=1..q-1)*(p-J[q])/mul(p^3-p+J[i]-J[i]^3,i=1..q)): end: #npJ(x,J):inputs an increasing list of pos. integers J and an integer (or symbol p) outputs n_q^(p)(J) in the BMV identity. Try: #npJ(11,[3,6,8]); npJ:=proc(x,J) local q,J1: option remember: q:=nops(J): if q=1 then RETURN(-12*J[1]^2*(x-J[1])/(x^3-x+J[1]-J[1]^3)): fi: J1:=[op(1..q-1,J)]: factor(normal(npJ(x,J1)*(-12)*J[q]*(J[q]-J[q-1])*(x-J[q])/(x-J[q-1])/(x^3-x+J[q]-J[q]^3))): end: #gpJ(x,J):inputs an increasing list of pos. integers J and an integr (or symbol p) outputs g_q^(p)(J) in Alberto Maspero's identity. Try: #gpJ(11,[3,6,8]); gpJ:=proc(x,J) local q: q:=nops(J): if q=1 then RETURN(-28/9*x^2+29/45+274/45*J[1]^2-1/6*(x^3-x)/J[1]+1/5*(x^3-x)*(x+J[1])/(x^2+x*J[1]+J[1]^2-1)-13/9*x*J[1]): fi: gpJ(x,[op(1..q-1,J)])+ 5/18*(x^3-x)*1/J[q]+ 38/15*J[q]^2+ (x^3-x)/5*(x+J[q])/(x^2+J[q]^2+x*J[q]-1) -13/9*J[q-1]*J[q] -13/9*(J[q]-J[q-1])*x +49/45 end: #gpJOld(p,J):inputs an increasing list of pos. integers J and an integr (or symbol p) outputs g_q^(p)(J) in Alberto Maspero's identity. Try: #gpJOld(11,[3,6,8]); gpJOld:=proc(x,J) local q,i: q:=nops(J): -28/9*x^2+49/45*q+32/9*J[1]^2-4/9-4/9*(x^3-x)/J[1]+ 5/18*(x^3-x)*add(1/J[i],i=1..q)+ 38/15*add(J[i]^2,i=1..q)+ (x^3-x)/5* add((x+J[i])/(x^2+J[i]^2+x*J[i]-1),i=1..q)-13/9*(add(J[i]*J[i+1],i=1..q-1)+J[q]*x): end: #IV1(p,q): The set of all increasing vectors of length q that end in p. Try: #IV1(6,3); IV1:=proc(p,q) local gu,gu1,p1: option remember: if q=1 then RETURN({[p]}): fi: gu:= {seq(op(IV1(p1,q-1)),p1=1..p-1)}: gu:={seq([op(gu1),p],gu1 in gu)}: gu: end: #IV(p): The set of all increasing vectors of positive integers that end in p. Try: #IV(6); IV:=proc(p) local q: {seq(op(IV1(p,q)),q=1..p)}: end: #IVn(p): The set of all increasing vectors that end in