#Yusra Naqvi #HW 27 #OK to post ################################################################################ #1. #SSe(S,N): inputs a positive integer N and outputs a sequence consisting of the #number of unlabelled rooted trees with outdegree in S union {0} SSe:=proc(S,N) local f,i,j,P,maxdeg,s,r: maxdeg:=max(S): P:=add(CIPseq(maxdeg,s)[i],i in S minus {0}): f:=x: for i from 1 to N do: f:=x+x*subs({seq(s[r]=subs(x=x^r,f),r=1..maxdeg)},P): f:=add(coeff(f,x,j)*x^j,j=1..N): od: [seq(coeff(f,x,j),j=1..N)]: end: ################################################################################ #2 #S for which SSe(S,20) is in OEIS: #{0,1,2}: #A036656 (also A1190) #{0,1,2,3}: #A598 #{0,1,2,3,4}: #A036718 #{0,1,2,3,4,5}: #A036721 #{0,1,2,3,4,5,6}: #A036722 #{0,1,2,3,4,5,6,7}: #A182378 (recently added by Michael Burkhart!) ################################################################################ ###Stuff from C27.txt### ################################################################################ #CIPseq(N,s): The cycle index polynomials for S_n for n=1..N. CIPseq:=proc(N,s) local n,t,f: f:=exp(add(s[n]*t^n/n,n=1..N)): f:=taylor(f,t=0,N+1): [seq(expand(coeff(f,t,n)),n=1..N)]: end: ################################################################################ ###End of Stuff from C27.txt ################################################################################