   function v = FirstCol(H,alfa)
 % H is an n-by-n matrix with the property that H(i,j) = 0 whenever i>j+1.
 % alfa is a column p-vector with p<n
 % v is the first column of the matrix (H-alfa(1)*I)*(H - alfa(2)*I)* ...
 % *(H - alfa(p)*I)
 
 [n,n] = size(H);
 p = length(alfa);
 
 % Compute the first column of H - alpha(p)I...
 v = H(:,1); v(1) = v(1)-alfa(p);
 for k=2:p
     % Note that v(k+1:n) is zero.
     % Compute w = (H - alpha(p-k+1)I)v = Hv - alpha(k)v
     w = zeros(k+1,1);
     % get Hv ...
     for j=1:k
         w(1:j+1) = w(1:j+1) + H(1:j+1,j)*v(j);
     end
     % subtract alpha(p-k+1)*v(1:k)...
     w(1:k) = w(1:k)-alfa(p-k+1)*v(1:k);
     % v = first col of (H - alfa(p-k+1)I)*...*(H - alfa(p)I) ...
     v(1:k+1) = w(1:k+1); 
 end 