#OK to post homework #Joseph Koutsoutis, 04-20-2025, Assignment 23 read `C23.txt`: #1 TT := proc(n) local T1,T2,T3,k1,k2,T,t1,t2,t3: if n=1 then RETURN({[]}): fi: if n=2 then RETURN({}): fi: T:={}: for k1 from 1 to n-2 do: for k2 from k1+1 to n-1 do: T1 := TT(k1): T2 := TT(k2 - k1): T3 := TT(n - k2): T := T union {seq(seq(seq( [ t1,t2,t3 ] , t1 in T1), t2 in T2), t3 in T3)}: od: od: T: end: T3 := proc(N) local x,f,i: f := x: for i from 1 to N do f := expand(x+f^3): f := add(coeff(f,x,i)*x^i,i=1..N): od: [seq(coeff(f,x,i),i=1..N)]: end: Images3 := proc(T) local T1,T2,T3,t1,t2,t3,S: if T=[] then RETURN({[]}): fi: T1 := Images3(T[1]): T2 := Images3(T[2]): T3 := Images3(T[3]): S:={}: for t1 in T1 do for t2 in T2 do for t3 in T3 do S:=S union {[t1,t2,t3],[t1,t3,t2],[t2,t1,t3],[t2,t3,t1],[t3,t1,t2],[t3,t2,t1]}: od: od: od: S: end: UBT3 := proc(n) local S1,S2,S3: S1 := TT(n): S2 := {}: while S1<>{} do S3:=Images3(S1[1]): S2:=S2 union {S1[1]}: S1:=S1 minus S3: od: S2: end: UT3 := proc(N) local x,f,i: f := x: for i from 1 to N do f:=expand(x+(f^3+3*f*subs(x=x^2,f)+2*subs(x=x^3,f))/6): f:=add(coeff(f,x,i)*x^i,i=1..N): od: [seq(coeff(f,x,i),i=1..N)]: end: #UT3(40) outputs #[1, 0, 1, 0, 1, 0, 2, 0, 4, 0, 8, 0, 17, 0, 39, 0, 89, 0, 211, 0, 507, 0, 1238, 0, 3057, 0, 7639, 0, 19241, 0, 48865, 0, 124906, 0, 321198, 0, 830219, 0, 2156010, 0] #This corresponds to https://oeis.org/A000598 #2 #If we set: #A := [[a11,a12,0],[0,a22,0],[0,0,a33]] #B := [[b11,b12,0],[0,b22,0],[0,0,b33]] #We find that Mul(A,B) - Mul(B, A) outputs #[[0, a11*b12 - a12*b11 + a12*b22 - a22*b12, 0], # [0, 0, 0], # [0, 0, 0]] #Hence Mul(Mul(A1,A2)-Mul(A2,A1), Mul(A3,A4)-Mul(A4,A3))=[[0,0,0],[0,0,0],[0,0,0]]