From this question,
Asymptotic formula for $\sum_{n\le x}\frac 1n$
The author claims without proof that this identity holds.
$$\sum_{n≤x} 1/n= \log(x)+\gamma +O(1/x) .$$
It is apparently well known enough, but I can't seem to figure out where the $\gamma$ would come from. Can someone provide a reference or help?
Denote $S_n = \sum_{k=1}^{n}\frac{1}{k}-\ln(n)$,
we could have: $$S_{n+1}-S_{n}= \frac{1}{n+1}-\ln(\frac{n+1}{n})$$
with a more trivial fact that $\frac{x}{1+x}<\ln(1+x)$ when $x>0$, let$x=\frac{1}{n}$, then we could know $S_n$ is a monotonically decreasing sequence.
since $S_n=\sum_{k=1}^{n}\frac{1}{n}-\ln(n)>\sum_{k=1}^{n}\int_{k}^{k+1}\frac{1}{x} dx-\ln(n)=\int_{1}^{n+1}\frac{1}{x}dx-\ln(n)=\ln(n+1)-\ln(n)>0$
we could know $\lim\limits_{n\to\infty}S_n$ do exist by monotone convergence theorem.