tol=0.0001
total=0;
iMax=100000
for i=1:iMax
    % term t(i) to add the sum
    ti=1/i;
    % add to total
    total=total+ti;
    estError=abs(i*ti);
    if estError <= tol
        break
    end
end
total
estError
