% USPINEQ 
%
function k0=uspineq(n,lam)
ab=r_jacobi(n+1,lam-.5);
k0=0;
for k=1:n
%
% Note that in gauss.m the zeros are ordered increasingly.
%
  xw=gauss(k,ab); xw1=gauss(k+1,ab);
  if (k+1)*acos(xw1(k,1))-k*acos(xw(k,1))>=pi
    k0=k;
    break
  end
end
