total=0.;
for n=1:100000
    t_n=1/n^2;
    total=total+t_n;
    estError=n*t_n;
    if estError <= tol
        break
    end
end
total
totalExact=pi^2/6
