Help:=proc(): print(`Par(n), Par1(n,k) , P(N), Pf(N),Pgf(n,q) `): print(`Pgf1(n,q), p(n), Pff(N) `): end: #Par(n): the set of integer-partitions of n Par:=proc(n) local k: option remember: {seq( op(Par1(n,k)),k=1..n)}: end: #Par1(n,k): the set of partitions of n whose #largest part is k Par1:=proc(n,k) local k1,beth,b,S: option remember: if n=1 then if k=1 then RETURN({[1]}): else RETURN({}): fi: fi: if n=k then RETURN({[n]}): fi: if k<=0 or k>n then RETURN({}): fi: S:={}: for k1 from 1 to k do beth:=Par1(n-k,k1): S:=S union {seq([k,op(b)], b in beth)}: od: S: end: #par(n): the number of integer-partitions of n par:=proc(n) local k: option remember: add(par1(n,k),k=1..n): end: #par1(n,k): the number of partitions of n whose #largest part is k par1:=proc(n,k) local S,k1: option remember: if n=1 then if k=1 then RETURN(1): else RETURN(0): fi: fi: if n=k then RETURN(1): fi: if k<=0 or k>n then RETURN(0): fi: add(par1(n-k,k1),k1=1..k): end: #P(N): the first N terms of the partition function P:=proc(N) local n: [seq(par(n),n=1..N)]: end: #(1+q+q^2+q^3+.....)*(1+q^2+q^4+q^6+...)*(1+q^3+q^6+...)*... #mul(1/(1-q^i),i=1..infinity); Pf:=proc(N) local q,lara,i: lara:=taylor(mul(1/(1-q^i),i=1..N),q=0,N+1): [seq(coeff(lara,q,i),i=1..N)]; end: Pgf:=proc(N,q) local i: convert(taylor(mul(1/(1-q^i),i=1..N),q=0,N+1),polynom): end: Pgf1:=proc(N,q) local i: convert(taylor(mul((1-q^i),i=1..N),q=0,N+1),polynom), add((-1)^i*q^(i*(3*i-1)/2),i=-sqrt(N)..sqrt(N)): end: p:=proc(n) local j: option remember: if n=0 then 1: elif n<0 then 0: else add(-(-1)^j*p(n-(3*j+1)*j/2),j=1..trunc(sqrt(n))+2)+ add(-(-1)^j*p(n-(3*j-1)*j/2),j=1..trunc(sqrt(n))+2): fi: end: Pff:=proc(N) local i:[seq(p(i),i=1..N)]:end: