show/hide this revision's text 3 relevant math typo corrected, sorry for the noise

Yes, there is a rule. There are results that are finer than merely $H_k - \ln k - \gamma$ tends to $0$ and explain this pattern.

More specifically, let us consider some more terms of the asymtotic expansion of $H_k$ . One has for example $$H_k = \ln k + \gamma + \frac{1}{2k} - \frac{1}{12k^2} + O(k^{-4}) $$ and this is even true with a small implied constant, or more precisely this is true with $O(k^{-4})$ replaced by $x_k\frac{1}{120}k^{-4}$ with $0 \le x_k \le 1$. Thus the error to be expected when doing the calculation in the question is $$\frac{1}{2k} - \frac{1}{12k^2}$$ up to something still (much) smaller, and this .

This is precisely what one gets. Thus sees; if one chooses for $k$ a power of $10$ one sees a nice pattern (the $10$ being special due to the fact that one has the decimal representation; if one chooses a different base for the representation, powers of that base become special); it is the beginning of the decimal representation of $$\frac{1}{2} 10^{-j} - \frac{1}{12} 10^{-2j}$$10^{-2j} ;$$ how long it is really just this can also be known from the estimate of the error mentioned above.

One can continue on this, as it is known that $$H_k = \ln k + \gamma + \frac{1}{2k} - \sum_{i=1}^{n-1} \frac{B_{2i}}{2i k^{2i}} + O(n^{-2k})$$O(k^{-2n})$$ and more precisely the $O(n^{-2k})$ can be replaced by $x_{k,n}( -\frac{B_{2n}}{2n}) k^{-2n} $ with $0\le x_{k,n} \le 1$ where the $B$'s are the Bernoulli numbers; some care is needed if one would want to try to see more complex patterns as the Bernoulli numbers while small at first then grow very fast, so that then the implied constant is large and the $k$ needs to be sufficiently large (relative to the $n$) to see the pattern for all the terms.

Besides the approximation I mentiond above there are various other approximations known. Also, questions like this are closely linked, essentially equivalent, to questions on the Digamma function .

show/hide this revision's text 2 expanded

More specifically, let us consider some more terms of the asymtotic expansion of $H_k$ . One has for example$$\ln $H_k = \ln k + \gamma + \frac{1}{2k} - \frac{1}{12k^2} ... + O(k^{-4}) $$ and this is even true with a small implied constant, or more precisely this is true with $O(k^{-4})$ replaced by $x_k\frac{1}{120}k^{-4}$ with $0 \le x_k \le 1$.Thus the error to be expected when doing the calculation in the question is $$\frac{1}{2k} - \frac{1}{12k^2}$$ up to something still (much) smaller, and this is what one gets. Thus if one chooses for $k$ a power of $10$ one sees a nice pattern (the $10$ being special due to the fact that one has the decimal representation; if one chooses a different base for the representation, powers of that base become special); it would is the beginning of the decimal representation of $$\frac{1}{2} 10^{-j} - \frac{1}{12} 10^{-2j}$$; how long it is really just this can also be known from the estimate of the error mentioned above.

One can continue further with on this, as it is known that $$H_k = \ln k + \gamma + \frac{1}{2k} - \sum_{i=2}^{\infty} sum_{i=1}^{n-1} \frac{B_{2i}}{2i k^{2i}}$)k^{2i}} + O(n^{-2k})$$and more precisely the $O(n^{-2k})$ can be replaced by $x_{k,n}( -\frac{B_{2n}}{2n}) k^{-2n} $ with $0\le x_{k,n} \le 1$ where the $B$'s are the Bernoulli numbers; some care is needed if one would want to try to see more complex patterns as the Bernoulli numbers while small at first then grow very fast, so that then the implied constant is large and the $k$ needs to be sufficiently large (relative to the $n$) to see the pattern for all the terms.

Besides the approximation I mentiond above there are various other approximations known. Also, questions like this are closely linked, essentially equivalent, to questions on the Digamma function .

show/hide this revision's text 1

Yes, there is a rule. There are results that are finer than merely $H_k - \ln k - \gamma$ tends to $0$ and explain this pattern.

More specifically, let us consider some more terms of the asymtotic expansion of $H_k$ . One has

$$\ln k + \gamma + \frac{1}{2k} - \frac{1}{12k^2} ... $$

(and it would continue further with $ - \sum_{i=2}^{\infty} \frac{B_{2i}}{2i k^{2i}}$).