Relationship between Partial Harmonic Sum and Logarithm.

Claim: $$H_n = \ln n + C + O(\frac{1}{n})$$ where $C$ is the Euler–Mascheroni constant ($=0.5772156649...$)

Proof: For any natural $k$ and $x$ such that $k-1 \le x < k$, we have $[x] = k-1$. Hence, we also have $$\frac{1}{k} = \frac{1}{[x] + 1}$$ Therefore, $$\frac 1k = \int_{k-1}^k \frac 1k dx = \int_{k-1}^k \frac{dx}{[x]+1}$$ Now, summing the above equality from $1$ to $n$, we get $$\sum_{k=1}^n\frac 1k = \sum_{k=1}^n\int_{k-1}^k \frac 1k dx = \int_{0}^n \frac{dx}{[x]+1}$$ We subtract the following equality from the above one: $$\ln(n+1) = \int_0^n \frac{dx}{x+1}$$ to get $$\sum_{k=1}^n \frac 1k - \ln(n+1) = \int_0^n \left( \frac{1}{[x]+1} - \frac{1}{x+1}\right)dx = \int_0^n \frac{x - [x]}{([x]+1)(x+1)}dx =: C_n$$ We denote $C = \lim C_n$ since $0 \le x-[x] < 1$ implies $$0 \le \frac{x - [x]}{([x]+1)(x+1)} < \frac{1}{x^2}, \ \ x\ge 1$$ which implies the improper integral (note: $\lim C_n$ was an improper integral) is convergent. Now, if we integrate the above inequality from $n$ to $\infty$, we get $$0 \le \int_n^\infty \frac{x - [x]}{([x]+1)(x+1)}dx \le \int_n^\infty \frac{dx}{x^2} = \frac 1n$$ Hence, we have $$\int_0^n \frac{x - [x]}{([x]+1)(x+1)}dx = C + O(\frac 1n), \ \ n\in \mathbb N$$ Therefore, we conclude $$\sum_{k=1}^n \frac{1}{k} = \ln(n+1) + C + O(\frac 1n)$$ Finally, noting that $\ln(n+1) = \ln n + O(1/n)$ completes the proof. $\square$


You may also use creative telescoping by noticing that $\frac{1}{k}$ is pretty close to $\log(k+1)-\log(k)=\log\left(1+\frac{1}{k}\right)$ for any large $k$. Indeed

$$ H_n -\log(n+1) = \sum_{k=1}^{n}\underbrace{\left(\frac{1}{k}-\log\left(1+\frac{1}{k}\right)\right)}_{\Theta(1/k^2)}=O(1) $$ and the approximation can be further improved by noticing that $\frac{1}{k}-\log\left(1+\frac{1}{k}\right)$ is pretty close to $\log\left(\frac{12k+1}{12k-5}\right)-\log\left(\frac{12k+13}{12k+7}\right)$:

$$ H_n = \log(n+1)+\gamma-\sum_{k>n}\left(\frac{1}{k}-\log\left(1+\frac{1}{k}\right)\right) $$

$$ H_n = \log(n+1)+\gamma-\log\left(\frac{12n+13}{12n+7}\right)+\sum_{k>n}\left(\frac{1}{k}-\log\left(1+\frac{1}{k}\right)-\log\left(\frac{12k+1}{12k-5}\right)-\log\left(\frac{12k+13}{12k+7}\right)\right) $$

$$\boxed{H_n=\log(n+1)+\gamma+\log\left(\frac{12n+7}{12n+13}\right)+O\left(\frac{1}{n^3}\right)}$$

where $\gamma$ is the Euler-Mascheroni constant, corresponding to $\sum_{k\geq 1}\left(\frac{1}{k}-\log\left(1+\frac{1}{k}\right)\right)$.