It is known that the sequence $\gamma_n = 1+ \frac{1}{2}+\cdots + \frac{1}{n}-\log(n)$ converges to $\gamma$ = 0.5772156649, wich is called Euler's constant. Find the minimum $n$ so that $\gamma_n$ is less than $10^{-4}$ from $\gamma$.
I am solving some exercises of numerical analysis but when I get to this I have no idea how to start. My first idea was to directly replace $ n $ but I have not made any progress. Could you give me any suggestions or what material to read in order to solve the problem? Thanks
As @cavok commented, if $$\gamma_n = -\log(n) + \sum_{k=1}^n \frac{1}{k}=-\log(n)+H_n$$ and you want to find $n$ such that $$|\gamma_n-\gamma| \leq \epsilon$$ use the asymptotics of harmonic numbers and you need to find $n$ such that $$\frac{1}{2 n}-\frac{1}{12 n^2}+\frac{1}{120 n^4}+O\left(\frac{1}{n^6}\right) \leq \epsilon$$ For sure, you could take the first and second terms and solve the quadratic equation.
I suppose that $n=\frac 1{2 \epsilon}$ will be very close.
Let us try with $\epsilon=0.001$ and use $n=500$ $$\gamma_{500}=0.578215 \implies |\gamma_n-\gamma|=0.000999667$$