# # # interface(quiet=true): die:=rand(1..6): C23:= linalg[matrix]([ [1,a,0,0,0], [0,1,b,c,0], [0,0,0,1,d]]): C33:= linalg[matrix]([ [1,a,b,0,0,0], [0,1,c,d,e,0], [0,0,0,1,f,g]]): Coords:= linalg[matrix]([ [1,a,b,c,f,s,0,0,0], [0,1,d,e,g,t,v,w,0], [0,0,0,1,h,u,x,y,z]]): m:=5: if m=2 then CM:=C23: fi: if m=3 then CM:=C33: fi: if m>3 then List:=[]: for i from 1 to m do List:=[List[],i]: od: List:=[List[],7,8,9]: CM:=linalg[submatrix](Coords,[1,2,3],List): fi: CM:= linalg[matrix]([ [1,0,0,a,b,c,f,s], [0,1,0,d,e,g,t,v], [0,0,1,h,u,x,y,z]]): COLS:=combinat[choose](m+3,3): lprint(3*m-2); for i from 1 to 3*m-2 do Poly:=0: for Col in COLS do Poly:= Poly+ die()*linalg[det](linalg[submatrix](CM,[1,2,3],convert(Col,list))): od: lprint(expand(Poly),`;`); od: quit;