#OK to post homework #George Spahn, 3/14/2021, Assignment 14 #BZ(L,j) inputs a partition L and an integer j, and outputs a pair [L', j'] # from the Bressoud Zeilberger bijective proof of Euler's recurrence BZ:=proc(L,j) local n,t: n:=add(L) + (3*j*j+j)/2: t:=nops(L): if t + 3*j < L[1] then RETURN([[seq(L[i]+1,i=1..t),seq(1,i=1..L[1]-3*j-t-1)],j-1]): else RETURN([[t+3*j-1,seq(L[i]-1,i=1..t)],j+1]): fi: end: #Glashier(L) input a partition into odd parts #output a partition into distinct parts #performing Glashier's famous bijective proof that these are equinumerous Glashier:=proc(L) local L2,i,c,d,vs,M,M2: L2:=[op(L),0]: c:=1: d:=L[1]: M:=[]: for i from 2 to nops(L2) do: if L2[i]=d then c:=c+1: else vs:=convert(c,base,2): M:=[op(M),seq(d*vs[j]*2^(j-1), j = 1..nops(vs))]: c:=1: d:=L2[i]: fi: od: M:=sort(M): M2:=[]: for i from nops(M) to 1 by -1 do if M[i] > 0 then M2:=[op(M2),M[i]]: fi: od: M2: end: #InvGlashier(L) input a partition into distinct parts #output a partition into odd parts #performing Glashier's famous bijective proof that these are equinumerous InvGlashier:=proc(L) local i,M,c,d,x: M:=[]: for i in L do c:=1: d:=i: for x while irem(d,2)=0 do c:=c*2: d:=d/2: od: M:=[op(M),d$c]: od: M:=sort(M,`>`): end: #SylvT(L) input a partition into odd parts #output a partition into distinct parts #performing Sylvester's function T in the proof that these are equinumerous SylvT:=proc(L) local r: if nops(L) = 0 then RETURN([]): fi: if max(L) = 1 then RETURN([nops(L)]): fi: for r from 1 to nops(L) do if L[r]=1 then break: fi: od: r:=r-1: [(L[1]-1)/2+nops(L), (L[1]-1)/2+r-1, op(SylvT( [seq(L[i]-2,i=2..r)] ))]: end: #SylvS(L) input a partition into distinct parts #output a partition into odd parts #performing Sylvester's function S in the proof that these are equinumerous SylvS:=proc(L) local rec: if nops(L) = 0 then RETURN([]): fi: if nops(L) = 1 then RETURN([1$L[1]]): fi: rec:=SylvS([seq(L[j],j=3..nops(L))]): [ 2*(L[2]-nops(rec))+1, seq(rec[j]+2,j=1..nops(rec)), 1$(L[1]-L[2]-1) ]: end: