#Homework by Mike Murr #OK to post #hw8 read(`C8.txt`); SPnF:=proc(n) local S, n1, SP1, i, S1, S2, n2, i2, chosen, chosenplus; if n=0 then return({{}}); fi; if n = 1 then return({{1}}); fi; SP1:={}; S:=SPnF(n-1); n1:=nops(S); print(n1); for i from 1 to n1 do S2:=convert(S, list); S1:=S2[i]; # print(S1); if n=2 then SP1:=SP1 union {{{n} union S1}}; SP1:=SP1 union {{{n}, S1}}; else SP1:=SP1 union {{{n} union S1[]}}; # print(SP1); SP1:=SP1 union {{{n}, S1[]}}; # print(SP1); n2 :=nops(S1); if n2 >= 2 then for i2 from 1 to n2 do chosen:=S1[i2]; chosenplus :={chosen union {n}}; SP1:=SP1 union {S1[1..i2-1] union S1[i2+1..n2] union chosenplus }; end do; fi; end if; end do; return(SP1); end proc; SPnF(0); SPnF(1); SPnF(2); SPnF(3); SPnF(4); # Exercise 3 # # expansion := taylor(log(Sum(2^(n*(n-1)/2)*x^n/n!,n=0..infinity)),x=0,31); expansion; seq(i!*coeff(expansion,x,i),i=1..30); # In the OEIS it is A001187