function [ab,dig]=dig_Enumod(N,nu,dig0,dd,nofdig)
%DIG_ENUMOD Number of digits needed to obtain polynomials orthogonal
%with respect to the exponential integral by a modified Chebyshev
%algorithm, using modified moments based on generalized Laguerre
%polynomials.
%   [AB,DIG]=DIG_ENUMOD(N,NU,DIG0,DD,NOFDIG) determines the number DIG 
%   of digits needed to obtain the first N recurrence coefficients for
%   the weight function w(x)=E_NU(x) on (0,Inf] to an accuracy of 
%   NOFDIG decimal digits using the modified Chebyshev algorithm based
%   on monic generalized Laguerre polynomials with parameter a=-1.
%   The routine successively increments an initial estimate DIG0 by
%   DD units until the required accuracy is achieved. The recurrence
%   coefficients to NOFDIG digits are placed into the Nx2 array AB.

tic
i=dig0-dd; 
maxerr=1;
while maxerr>.5*10^(-nofdig)
  i=i+dd; dig=i
  abm=sr_laguerre(dig,2*N-1,-1);
  mom=smmom_Enu(dig,N,nu);
  if i==dig0
    ab0=schebyshev(dig,N,mom',abm);
  else
    ab1=schebyshev(dig,N,mom',abm); ab1=vpa(ab1,15)
    serr=abs((ab1-ab0)./ab1);
    err=double(serr);
    maxerr=max(max(err)) 
    ab0=ab1;
  end
end
ab=vpa(ab1,nofdig);
toc
