function [P] = tracemsz(A)
n = max(size(A));
s = zeros(1,n);
S = eye(n);
for k=1:n, S=S*A;
    s(k) = trace(S);
end;
b = zeros(1,n);
for k=1:n, sum = s(k);
    for j=1:(k-1), sum = sum + b(j)*s(k-j);
    end;
    b(k) = - (sum / k);
end;
P = [1, b];
