Harmonic series sum approximation

Solution 1:

Yes, the sequence $H_n=1 + 1/2 + 1/3+\dots+ 1/n$ is strictly increasing and divergent. The question is asking for the minimal positive integer $n$ such that $H_n>4$.

Hint. Note that for any $n\geq 2$, $$\ln(n)=\int_{1}^n \frac{1}{x}dx < H_n< 1+\int_{1}^n \frac{1}{x}dx=1+\ln(n).$$ See for example Showing inequality for harmonic series.

Solution 2:

Just for your curiosity.

Making the problem more general, you want to find $n$ such that $H_n > p$ knowing that $n$ is large.

The series expansion of harmonic number being $$H_n=\gamma +\log \left({n}\right)+\frac{1}{2 n}+O\left(\frac{1}{n^2}\right)$$ Neglecting the higher order terms, you then need to solve for $n$ the equation $$\gamma +\log \left({n}\right)+\frac{1}{2 n}-p=0$$ the solution of which being given in terms of Lambert function $$n=-\frac{1}{2 W\left(-\frac{e^{\gamma -p}}{2}\right)}$$ Since the argument is small, you can approximate, for small $t$ $$W(t)=t-t^2+\frac{3 t^3}{2}+O\left(t^4\right)$$ Using $t=-\frac{e^{\gamma -p}}{2}$ this would give, in the real domain for $p=4$, $n\approx 30.1508$ while the "exact" solution would be $30.1533$.

If you want a simpler approximation, you could use the simplest Padé approximant $$W(t)=\frac t {1+t}$$ which, for the general case, would give the simple $$n\approx e^{p-\gamma }-\frac{1}{2}$$

Edit

The last expression seems to be a quite good approximation of the inverse of the harmonic number as shown below $$\left( \begin{array}{ccc} p & e^{p-\gamma }-\frac{1}{2} & \text{exact} \\ 1 & 1.02621 & 1.00000 \\ 2 & 3.64866 & 3.63868 \\ 3 & 10.7772 & 10.7735 \\ 4 & 30.1546 & 30.1533 \\ 5 & 82.8280 & 82.8275 \\ 6 & 226.009 & 226.009 \\ 7 & 615.215 & 615.215 \\ 8 & 1673.19 & 1673.19 \\ 9 & 4549.05 & 4549.05 \\ 10 & 12366.5 & 12366.5 \end{array} \right)$$

Later, searching the Internet, I found in $OEIS$ sequences $A118050$ and $A118051$ where David W. Cantrell proposed by series reversion an extremely accurate solution $$n=u-\frac 12 - \frac 1 {24\,u}+ \frac 3 {640\,u^3}- \frac {1525} {580608\,u^5}+O\left(\frac{1}{u^7}\right)\qquad \text{where}\qquad u= e^{p-\gamma }$$ which is, for sure, much more accurate for small values of $p$.

Using David W. Cantrell's expansion, we could make a good approximation of it using Padé approximant and get the shorter $$n=u-\frac 12-\frac 1 u \frac{136080\, u^2+60941}{3265920\, u^2+1830000}$$

Edit (four years later)

Currently working around simple approximations of harmonic numbers and their inverse, I obtained $$H_n \sim \frac{1}{2} \log \left(n^2+n+\frac{1}{2}\right)+\gamma-\frac{1}{12 \left(n^2+n+\frac{1}{2}\right)}$$ which has an asymptotic error of $\frac{1}{80 n^4}$ and its inverse is $$n\sim -\frac{1}{2}+\sqrt{\frac{1}{6 W(t)}-\frac{1}{4}}\quad \text{where} \qquad t=\frac{1}{2}e^{2(\gamma-H_n)}$$ Replacing $H_n$ by $p$ and repeating the same calculations as above, the new new estimates for the first values of $p$ are $$\{0.996835,3.63850,10.7735,30.1533,82.8275\}$$ which is much better.