### Kristen Lew, Homework 27 ### ExpMath, Spring 2012 ## Post if you wish. ### Problem 1 ## Finish Procedure SSe(Se,N) that we didn't have a chance to do in class. # SSe(Se, N): inputs a positive integers N and outputs the sequence consisting of the number of # unlabeled rooted trees with outdegree belonging to S3 with n vertices for n=1..N SSe:=proc(Se,N) local f,i,j,P,P2,P3,MAXdeg,s: if not member(0,Se) then RETURN(FAIL): fi: MAXdeg:=max(Se): P:=CIPseq(MAXdeg,s): P2:=[]: for i from 1 to nops( P) do if member(i,Se) then P2:=[op(P2),P[i]]: fi: od: P3:=add(P2[i],i=1..nops(P2)): f:=x: for j from 1 to N do f:=x+x*(subs({seq(s[i]=subs(x=x^i,f),i=1..MAXdeg)},P3)): f:=add(coeff(f,x,i)*x^i,i=0..j+1): od: [seq(coeff(f,x,i),i=1..N)]: end: 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: ### Problem 2 ## Find as many sets Se (that contain 0) for which SSe(Se,20) is in Sloane. # S:=powerset({1,2,3,4}): S2:={}: # for i in S do # i:= {0} union i: # S2:=S2 union {i}: # od: # seq(SSe(j,15),j in S2): # for j in S2 do # j, SSe(j,15): # od: ### Checked for all permutations of {1,2,3,4} union {0}: # {0}, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # A000007 # {0, 1}, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] # A000012 # {0, 2}, [1, 0, 1, 0, 1, 0, 2, 0, 3, 0, 6, 0, 11, 0, 23] # {0, 3}, [1, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 4, 0, 0] # {0, 4}, [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0] # {0, 1, 2}, [1, 1, 2, 3, 6, 11, 23, 46, 98, 207, 451, 983, 2179, 4850, 10905] # A001190 # {0, 1, 3}, [1, 1, 1, 2, 3, 5, 9, 16, 29, 55, 104, 200, 389, 763, 1507] # {0, 1, 4}, [1, 1, 1, 1, 2, 3, 5, 8, 14, 23, 40, 69, 123, 218, 393] # {0, 2, 3}, [1, 0, 1, 1, 1, 2, 3, 5, 8, 14, 23, 40, 70, 122, 217] # {0, 2, 4}, [1, 0, 1, 0, 2, 0, 4, 0, 9, 0, 23, 0, 59, 0, 159] # {0, 3, 4}, [1, 0, 0, 1, 1, 0, 1, 2, 1, 2, 5, 5, 6, 13, 18] # {0, 1, 2, 3}, [1, 1, 2, 4, 8, 17, 39, 89, 211, 507, 1238, 3057, 7639, 19241, 48865] # A000598 # {0, 1, 2, 4}, [1, 1, 2, 3, 7, 13, 29, 61, 139, 310, 720, 1665, 3931, 9304, 22281] # {0, 1, 3, 4}, [1, 1, 1, 2, 4, 7, 13, 25, 50, 101, 207, 430, 905, 1919, 4103] # {0, 2, 3, 4}, [1, 0, 1, 1, 2, 2, 5, 7, 14, 23, 45, 78, 151, 275, 530] # {0, 1, 2, 3, 4}, [1, 1, 2, 4, 9, 19, 45, 106, 260, 643, 1624, 4138, 10683, 27790, 72917] # A036718 ### Then decided to check how far OEIS went, if Se was of the form {0,1,2,3,..,n} # SSe({0,1,2,3,4,5},15); # [1, 1, 2, 4, 9, 20, 47, 112, 277, 693, 1766, 4547, 11852, 31146, 82534] # A036721 # SSe({0,1,2,3,4,5,6},15); # [1, 1, 2, 4, 9, 20, 48, 114, 283, 710, 1816, 4690, 12267, 32338, 85978] # A036722 # SSe({0,1,2,3,4,5,6,7},15); # [1, 1, 2, 4, 9, 20, 48, 115, 285, 716, 1833, 4740, 12410, 32754, 87176] # A182378 # SSe({0,1,2,3,4,5,6,7,8},15); # [1, 1, 2, 4, 9, 20, 48, 115, 286, 718, 1839, 4757, 12460, 32897, 87592] # Not in Sloane.