# Using the Euler-Maclaurin formula to approximate Euler's constant, $\gamma := \lim_{n\to\infty}\left(-\ln n+\sum_{k=0}^n\frac1n\right)$

Let $$\gamma=\lim_{n\to\infty} F(n)$$ where $$F(n)=1+\frac{1}{2}+\frac{1}{3}+\cdots\frac{1}{n}-\ln(n)$$ (This is Euler's constant.) How can I calculate $$\gamma$$ with $$10$$ digits of precision using the Euler-Maclaurin Formula?

The Euler-Maclaurin Formula says $$\sum_{k=1}^n\frac1k=\log(n)+\gamma+\frac1{2n}-\frac1{12n^2}+\frac1{120n^4}-\frac1{252n^6}+\frac1{240n^8}\color{#C00}{-\frac1{132n^{10}}}+\dots$$ If we use $n=10$ and the expansion with and without the red term, we get that $$0.5772156649008\le\gamma\le0.5772156649016$$ Thus, to $10$ places we get $$\gamma=0.5772156649$$
• Where does the $\gamma$ come from in $\sum_{k=1}^n\frac1k=\log(n)+\gamma+\frac1{2n}-\frac1{12n^2}+\frac1{120n^4}-\frac1{252n^6}+\frac1{240n^8}\color{#C00}{-\frac1{132n^{10}}}+\dots$? – mathie12 Jun 17 '18 at 14:54
• The definition of $$\gamma=\lim_{n\to\infty}\left(\sum_{k=1}^n\frac1k-\log(n)\right)$$ – robjohn Jun 17 '18 at 15:18
• I don't know if I understand, what I thought you did was: $\sum_{k=1}^n\frac1k=\int_1^{n}\frac1xdx+\sum_{k=1}^p\frac{B_k}{k!}(f^{k-1}(n)-f^{k-1}(m))$ And doing this I get $\sum_{k=1}^n\frac1k=\log(n)+\frac1{2n}-\frac1{12n^2}+\frac1{120n^4}+\frac{-1}{2}+\frac{1}{12}+\frac{1}{120}\dots$. What did I do wrong? – mathie12 Jun 17 '18 at 16:23
• Essentially, the way I am using the Euler-Maclaurin Sum Formula is to estimate the tail of the sum. That is, using $m$ large and $n\to\infty$. If we try to use the formula for $m=1$ and large $n$, then the sum usually diverges, which makes it hard to use. – robjohn Jun 17 '18 at 19:32