H:=proc(): print(`binomial1(a,b) `): print(`qbinomial(a,b,q) , Gauss1(a,b,q)`): print(`TermK(P1, Sh1,m,G)`): print(` Par1(n,k), Par(n)`): end: binomial1:=proc(a,b::posint) local i: convert([seq(a-i,i=0..b-1)],`*`)/b!: end: binomial2:=proc(a,b) local i: a!/b!/(a-b)!; end: qbinomial:=proc(a,b::posint,q) local i: sort(expand(normal(convert([seq((1-q^(a-i+1))/(1-q^i) ,i=1..b)],`*`)))) : end: Gauss1:=proc(a,b,q): qbinomial(a+b,b,q):end: #[5,4,1,1,1] [ [1,3], [4,1], [5,1] ] Par1:=proc(n::posint, i::posint) local j, tem,m,tem1,i1,i2: option remember: if i=1 then RETURN({[[1,n]]}): fi: tem:={}: for j from 1 to trunc(n/i) do m:=n-i*j: if m=0 then RETURN(tem union {[[i,j]]}): fi: for i1 from 1 to i-1 do tem1:=Par1(m,i1): tem:= tem union {seq([ op(tem1[i2]) , [i,j] ], i2=1..nops(tem1) )}: od: od: tem: end: Par:=proc(n::posint) local i: option remember: {seq(op(Par1(n,i)), i=1..n)}:end: TermK:=proc(P1, Sh1,m,G) local i1,po,k: k:=add(P1[i1][1]*P1[i1][2],i1=1..nops(P1)): if nops(P1)<>nops(Sh1) then ERROR(`nops(P1) should be equal to nops(Sh1)`): fi: po:=add(Sh1[i1]*P1[i1][1],i1=1..nops(P1)): if po mod 2 <>0 then RETURN(FAIL): fi: q^(po/2)* convert( [seq(G(m*P1[i1][2]-Sh1[i1],P1[i1][1]),i1=1..nops(P1))],`*`): end: