MathorynMathematical Formula Database

Sequences & Series

Harmonic Numbers

The nn-th harmonic number is the sum of the reciprocals of the first nn positive integers. It grows like ln⁡n\ln n plus the Euler–Mascheroni constant γ≈0.5772\gamma\approx0.5772, which shows that the harmonic series diverges. It is used in algorithm analysis and probability.

Hn=∑k=1n1k≈ln⁡n+γ+12nH_n=\sum_{k=1}^{n}\frac1k\approx\ln n+\gamma+\frac{1}{2n}
LaTeXH_n=\sum_{k=1}^{n}\frac1k\approx\ln n+\gamma+\frac{1}{2n}

Variables

HnH_n
n-th harmonic number
γ\gamma
Euler–Mascheroni constant ≈ 0.5772157
nn
positive integer

Example

Compute H10H_{10} and compare with the approximation.

  1. H10=1+12+⋯+110≈2.928968H_{10}=1+\frac12+\cdots+\frac1{10}\approx2.928968.
  2. ln⁡10+γ+120≈2.302585+0.577216+0.05\ln10+\gamma+\frac1{20}\approx2.302585+0.577216+0.05.

Answer: H10≈2.92897H_{10}\approx2.92897 versus the approximation 2.929802.92980.

Related formulas