Harmonic Number Calculator

Find any harmonic number Hₙ.

Result

2.928968

How it is calculated

The n-th harmonic number is the sum of the reciprocals of the first n whole numbers: Hn = 1 + 1/2 + 1/3 + … + 1/n. The tool adds the terms one by one and shows the total to six decimals. The input is cut down to a whole number (10.9 is read as 10) and must lie between 1 and 1,000,000; anything outside that range gives no result. The sum grows without limit but very slowly, roughly like ln n + 0.5772, where 0.5772 is the Euler–Mascheroni constant. That approximation is a quick check on the exact figure.

Worked example

For n = 10, add 1 + 0.5 + 0.3333 + 0.25 + 0.2 + 0.1667 + 0.1429 + 0.125 + 0.1111 + 0.1. The tool, which keeps full precision for each term, reports 2.928968. The quick estimate ln 10 + 0.5772 + 1/20 is about 2.9298, close to the exact value. For n = 100 the sum is 5.187378, so ten times as many terms add only about 2.26.

Try this example →

Common mistakes

  • Entering a decimal such as 10.9 and expecting rounding. The tool drops the fraction and uses 10.
  • Expecting the series to settle at a limit. Unlike the sum of 1/2k, the harmonic series grows forever, only slowly.
  • Confusing Hn with 1/n. The harmonic number is the sum of all reciprocals up to n, not the last one.
  • Entering 0 or a negative number, or a value above 1,000,000. The tool returns no result for these.
  • Using the ln n estimate without the 0.5772 constant, which misses the result by more than half a unit.

About this calculator

The nth harmonic number is the sum of reciprocals Hₙ = 1 + ½ + ⅓ + … + 1/n. It grows without bound but very slowly, approximately Hₙ ≈ ln(n) + γ, where γ ≈ 0.5772 is the Euler–Mascheroni constant — a fact famously counter-intuitive to students seeing the harmonic series diverge for the first time despite its terms shrinking to zero.

Computer scientists rely on harmonic numbers to analyze algorithm complexity — they appear in the average-case running time of quicksort, the expected number of trials in the coupon collector's problem, and the analysis of hashing and randomized algorithms. Mathematics students and educators also use them to illustrate series convergence versus divergence.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators