Help:=proc(): print(`Par(n), Par1(n,k), GuessPol(L,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: #GuessPol1(L,d,n): guesses a polynomial of degree d in n for # the list L, such that L[i]=P[i] for i>=s0 for example, try: #GuessPol1([(seq(i,i=1..10),1,n,1); GuessPol1:=proc(L,d,n) local P,i,a,eq,var: if d>=nops(L)-3 then ERROR(`the list is too small`): fi: P:=add(a[i]*n^i,i=0..d): var:={seq(a[i],i=0..d)}: eq:={seq(subs(n=i,P)-L[i],i=1..d+4)}: var:=solve(eq,var): if var=NULL then RETURN(FAIL): fi: subs(var,P): end: #GuessPol(L,n): guesses a polynomial of degree d in n for # the list L, such that L[i]=P[i] for i>=1 for example, try: #GuessPol([(seq(i,i=1..10),n); GuessPol:=proc(L,n) local d,gu: for d from 0 to nops(L)-4 do gu:=GuessPol1(L,d,n): if gu<>FAIL then RETURN(gu): fi: od: FAIL: end: