TAOCP 1.2.7 Exercise 5

By the asymptotic expansion for harmonic numbers in Appendix A, H_n = \ln n + \gamma + \frac{1}{2n} -\frac{1}{12n^2} +\frac{1}{120n^4} -\frac{1}{252n^6}

Section 1.2.7: Harmonic Numbers

Exercise 5. [15] Give the value of $H_{10000}$ to 15 decimal places, using the tables in Appendix A.

Verified: no
Solve time: -


Solution

By the asymptotic expansion for harmonic numbers in Appendix A,

$$ H_n = \ln n + \gamma + \frac{1}{2n} -\frac{1}{12n^2} +\frac{1}{120n^4} -\frac{1}{252n^6} +\cdots . $$

For $n=10000$,

$$ \ln 10000 = 4\ln 10. $$

Using the tables in Appendix A,

$$ \ln 10 = 2.302585092994046, \qquad \gamma = 0.577215664901533. $$

Hence

$$ \ln 10000 + \gamma = 4(2.302585092994046)+0.577215664901533 = 9.787555036877717. $$

Next,

$$ \frac{1}{2n}=\frac{1}{20000}=0.00005, $$

and

$$ \frac{1}{12n^2} = \frac{1}{12\cdot 10^8} = 0.000000000833333\ldots $$

Also,

$$ \frac{1}{120n^4} = \frac{1}{120\cdot 10^{16}} < 10^{-18}, $$

so this term and all subsequent terms do not affect the first $15$ decimal places.

Therefore

$$ H_{10000} = 9.787555036877717 +0.00005 -0.000000000833333\ldots $$

$$ = 9.787605036044383\ldots $$

Thus

$$ \boxed{H_{10000}=9.787605036044383} $$

to $15$ decimal places.