Harmonic Numbers
The -th harmonic number is the sum of the reciprocals of the first positive integers. It grows like plus the Euler–Mascheroni constant , which shows that the harmonic series diverges. It is used in algorithm analysis and probability.
LaTeX
H_n=\sum_{k=1}^{n}\frac1k\approx\ln n+\gamma+\frac{1}{2n}Variables
- n-th harmonic number
- Euler–Mascheroni constant ≈ 0.5772157
- positive integer
Example
Compute and compare with the approximation.
- .
- .
Answer: versus the approximation .