% Harmonic Series. Computer Problem (18) Section 1.3 Burden % Euler Constant clear; s=0; N=1.; g=0; Nmax=500000 while N<=Nmax & abs(0.5772156649-g)>=10^(-6) s=s+1./N; g=s-log(N); N=N+1.; end if N > Nmax disp('Increase Nmax'); else disp([N-1,g]); end