Mathwords logoMathwords

Harmonic Number — Definition, Formula & Examples

The nnth harmonic number, written HnH_n, is the sum of the reciprocals of the first nn positive integers: 1+12+13++1n1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n}. Harmonic numbers grow without bound as nn increases, but they do so very slowly.

For each positive integer nn, the nnth harmonic number is defined as Hn=k=1n1kH_n = \sum_{k=1}^{n} \frac{1}{k}. The sequence {Hn}\{H_n\} is strictly increasing and unbounded, meaning limnHn=\lim_{n \to \infty} H_n = \infty. For large nn, harmonic numbers satisfy the asymptotic relation Hnlnn+γH_n \approx \ln n + \gamma, where γ0.5772\gamma \approx 0.5772 is the Euler–Mascheroni constant.

Key Formula

Hn=k=1n1k=1+12+13++1nH_n = \sum_{k=1}^{n} \frac{1}{k} = 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n}
Where:
  • HnH_n = The $n$th harmonic number
  • nn = A positive integer indicating how many reciprocal terms to sum
  • kk = Index of summation running from 1 to $n$

How It Works

To compute HnH_n, simply add the fractions 11,12,13,,1n\frac{1}{1}, \frac{1}{2}, \frac{1}{3}, \ldots, \frac{1}{n}. Each successive harmonic number builds on the previous one: Hn=Hn1+1nH_n = H_{n-1} + \frac{1}{n}. Because each added term 1n\frac{1}{n} is positive, the sequence is strictly increasing. However, the terms shrink toward zero, so growth is extremely slow — you need over 104310^{43} terms before HnH_n exceeds 100.

Worked Example

Problem: Compute the 5th harmonic number, H5H_5.
Write out the sum: List the reciprocals of the first 5 positive integers.
H5=1+12+13+14+15H_5 = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5}
Find a common denominator: The least common denominator of 1, 2, 3, 4, and 5 is 60.
H5=6060+3060+2060+1560+1260H_5 = \frac{60}{60} + \frac{30}{60} + \frac{20}{60} + \frac{15}{60} + \frac{12}{60}
Add the fractions: Sum the numerators over the common denominator.
H5=60+30+20+15+1260=13760H_5 = \frac{60 + 30 + 20 + 15 + 12}{60} = \frac{137}{60}
Answer: H5=137602.2833H_5 = \dfrac{137}{60} \approx 2.2833

Why It Matters

Harmonic numbers appear throughout calculus and computer science. In algorithm analysis, the average number of comparisons in quicksort involves HnH_n. They also provide the classic proof that the harmonic series diverges, a foundational result in any study of infinite series.

Common Mistakes

Mistake: Assuming the harmonic series converges because its terms 1n\frac{1}{n} approach zero.
Correction: A series can diverge even when its terms tend to zero. The harmonic series is the most famous example — use the comparison test or the integral test to confirm divergence.