Maths & numbers

Harmonic number calculator

Sum reciprocals of consecutive positive integers.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Each new term adds 1/n. The sum grows slowly but is unbounded as n increases.

THE FORMULAHₙ = Σ 1/k, k = 1,…,n

A worked example

H₄ = 1 + 1/2 + 1/3 + 1/4 = 25/12.

Good to know

The output is a floating-point approximation.

Add reciprocals with a common denominator

For four terms, H₄ = 1 + 1/2 + 1/3 + 1/4. Using denominator twelve gives (12 + 6 + 4 + 3)/12 = 25/12, approximately 2.083333. The diagram shows the four unequal contributions in a stacked bar.

The recurrence Hₙ = Hₙ₋₁ + 1/n explains each additional contribution. H₀ is defined as zero, so the same recurrence starts with H₁ = 1. The calculator sums from the smallest reciprocal towards the largest to reduce some loss of tiny contributions in floating-point arithmetic.

The first four reciprocal terms sum to twenty-five twelfths11/21/31/4H₄ = 1 + 1/2 + 1/3 + 1/4H₄ = 25/12 ≈ 2.08333
A common denominator gives 12/12 + 6/12 + 4/12 + 3/12 = 25/12.

Explain why shrinking terms can still have an unbounded total

Group the terms after one into blocks with lengths 1, 2, 4 and 8. The block from 1/(2^(j−1) + 1) through 1/2ʲ contains 2^(j−1) terms, each at least 1/2ʲ. Every such block therefore adds at least 1/2. Infinitely many blocks force the total to grow without bound.

For n ≥ 1, integral comparison gives ln(n + 1) ≤ Hₙ ≤ 1 + ln n. This logarithmic growth is slow but unbounded. The Infinite geometric series sum calculator contrasts this behaviour with a convergent sum whose terms decrease by a fixed ratio. The harmonic-number field accepts a nonnegative integer term count, and its numerical output approximates the exact rational sum.

A few questions, answered

Is a harmonic number a harmonic mean?

No. Hₙ sums reciprocals. The harmonic mean of n positive values divides n by the sum of their reciprocals.

Why does the calculator limit the term count?

It performs a finite numerical sum. Bounding the number of iterations keeps the browser calculation responsive.

Find your calculator

Start typing to explore the library.