Help:=proc(): print(`Fn(n,q), Fni(n,i,q), Gn(n,q), Gni(n,i,q),`): print(`Gnji(n,j,i,q)`): end: #Fn(n,q): the generating function according to inv of S_n Fn:=proc(n,q) local i: option remember: if n=0 then RETURN(1): fi: add(Fni(n,i,q),i=1..n): end: #Fni(n,i,q): the gen. fun. according to inv of the #set of prems on {1, ..., n} that end in i Fni:=proc(n,i,q) option remember: if n<0 then ERROR(`Bad input`): fi: sort(expand(q^(n-i)*Fn(n-1,q))): end: #Gn(n,q): the generating function according to maj of S_n Gn:=proc(n,q) local i: option remember: if n=0 then RETURN(1): fi: add(Gni(n,i,q),i=1..n): end: #Gni(n,i,q): the gen. fun. according to maj of the #set of prems on {1, ..., n} that end in i Gni:=proc(n,i,q) option remember: if n<0 then ERROR(`Bad input`): fi: add(Gnji(n,j,i,q),j=1..i-1)+add(Gnji(n,j,i,q),j=i+1..n): end: Gnji:=proc(n,j,i,q) option remember: end: