%%%%%%%%%%% Gchar.txt %%%%%%%%%%% Help:=proc():print(`Circ(x,k),Prod(pi,sig)`): print(`Gdet(x,k)`): end: with(linalg): with(combinat): Circ:=proc(x,k) local M,i,j: M:=matrix(k,k,[ seq(seq(x[(i+j) mod k],i=0..k-1),j=0..k-1)]): factor(det(M)): end: #prod(pi,sig): the product of the perms #pi and sig (of the same length) Prod:=proc(pi,sig) local i,k: k:=nops(pi): [seq(pi[sig[i]],i=1..k)]: end: #Gdet(x,k), inputs a pos. integer k and outputs #the matrix representing the multiplication #table (for S_k) #in symboilc form using x[i] to denote #the i-th member of S_k . It outputs the group-det Gdet:=proc(x,k) local S,M,i,j: S:=permute(k): M:=matrix(k!,k!): for i from 1 to nops(S) do for j from 1 to nops(S) do M[i,j]:=Prod(S[i],S[j]): od: od: factor(det(subs({seq(S[i]=x[i],i=1..nops(S))}, op(M)))): end: