Help:=proc(): print(`Wt(pi,S), CIP(G,s), S2(N), s3(N) `): print( ` CIPseq(N,s) `): end: with(combinat): with(group): ###From C26.txt #Wt(pi,s): the weight (according to Polya) of #the permutation pi #For example : Wt([1,2,3],s)=s[1]^3 Wt:=proc(pi,s) local L,n,i,y,W: n:=nops(pi): L:=convert(pi, `disjcyc`); W:=mul( s[ nops(L[i])], i=1..nops(L)): W*s[1]^n/subs({seq(s[i]=s[1]^i,i=2..n)},W): end: #CIP(G,s): inputs a group (or even a set) of permutations #and outputs the Polya Cycle-index polynomial #1/|G| *( Sum of the weights of all pi in G) #weight(pi)=prod(s[i]^(#of cycles of length i) #s is a letter #For example, #wt([2,1,4,5,3])=s[2]^1*s[3]^1=s[2]*s[3] #wt([1,2,3,4,5,6])=s[1]^6 #wt([2,3,4,5,6,1])=s[6] CIP:=proc(G,s) local pi: add(Wt(pi,s), pi in G)/nops(G): end: ###End C26.txt #T(x)=x+x*(T(x)+T(x)^2/2+T(x^2)/2) #s2(N): inputs a pos. integer N and outputs #the sequence consisting of the number of #unlabelled rooted trees with outdegree in {0,1,2} #with n vertices for n=1..N S2:=proc(N) local f,i,brian: f:=x: for i from 1 to N do f:=expand(x+x*(f+f^2/2+ subs(x=x^2,f)/2)): f:=add(coeff(f,x,brian)*x^brian,brian=0..N): od: [seq(coeff(f,x,brian),brian=1..N)]: end: #T(x)=x+x*( T(x)+ 1/2*T(x)^2+T(x^2)/2+ #(1/6)*T(x)^3+1/2*T(x^2)*T(x)+1/3*T(x^3) #s3(N): inputs a pos. integer N and outputs #the sequence consisting of the number of #unlabelled rooted trees with outdegree in {0,1,2,3} #with n vertices for n=1..N S3:=proc(N) local f,i,brian: f:=x: for i from 1 to N do f:=expand(x+x*(f+f^2/2+ subs(x=x^2,f)/2 +f^3/6+1/2*subs(x=x^2,f)*f+1/3*subs(x=x^3,f)) ): f:=add(coeff(f,x,brian)*x^brian,brian=0..N): od: [seq(coeff(f,x,brian),brian=1..N)]: end: #exp(s[1]*t+s[2]*t^2/2+s[3]*t^3/3+...) #CIPseq(N,s): The Polya cycle-index polynomials #for S_n for n=1..N using s[1], ... , s[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: #SSe(Se,N): Under Construction #inputs pos. integers k, N and outputs #the sequence consisting of the number of #unlabelled rooted trees with outdegree belonging to Se #with n vertices for n=1..N SSe:=proc(Se,N) local f,i,brian,P,MAXdeg,s: MAXdeg:=max(Se): P:=CIPseq(MAXdeg,s): end: