Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
The nth harmonic number, H_n = 1 + 1/2 + 1/3 + ... + 1/n, is the sum of the reciprocals of the first n positive integers. Despite each added term getting smaller and smaller, the harmonic series famously diverges — H_n grows without bound as n increases, just extremely slowly (logarithmically). Harmonic numbers show up in the analysis of algorithms (the expected running time of quicksort and several other classic algorithms involves H_n), in physics (overtones of a vibrating string relate to reciprocals of integers), and in probability (the "coupon collector's problem," which asks how many random draws are needed to collect every one of n distinct items, has an expected answer of n·H_n).
How it works
Enter n. The calculator sums 1 + 1/2 + 1/3 + ... + 1/n term by term to get the exact value, and also reports the closed-form approximation ln(n) + γ, where γ (gamma) is the Euler-Mascheroni constant. This approximation comes from comparing the discrete sum to the continuous integral ∫(1/x)dx = ln(x), and the gap between the two settles down to the constant γ as n grows large.
- Enter n.
- Click Calculate to see your results.
Examples
n = 4
H_4 = 1 + 1/2 + 1/3 + 1/4 = 12/12 + 6/12 + 4/12 + 3/12 = 25/12 ≈ 2.0833.
n = 10
H_10 = 1 + 1/2 + ... + 1/10 ≈ 2.9290. The approximation ln(10) + γ ≈ 2.3026 + 0.5772 ≈ 2.8798, already fairly close despite n being small.
Common mistakes to avoid
- Confusing the harmonic number with the harmonic mean — they are different concepts that both involve reciprocals.
- Assuming the harmonic series converges to a finite value like some other infinite sums do — it diverges, just very slowly.
- Forgetting that the ln(n) + γ approximation is only close for reasonably large n; for small n the exact sum and the approximation can differ noticeably.