Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Harmonic Number H(n)
2.928968
sum of 1/k for k = 1 to n
Number of terms (n) 10
Harmonic number 2.928968254

What is a Harmonic Number?

The nth harmonic number, written \(H(n)\), is the sum of the reciprocals of the first n positive integers: $$H(n) = 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n}.$$ It is the partial sum of the famous harmonic series, one of the most important slowly-diverging series in mathematics. Although each added term gets smaller, the total grows without bound as n increases — just very slowly, roughly like the natural logarithm of n.

Stacked unit fractions summing to a harmonic number
A harmonic number is the sum of the unit fractions \(1, \frac{1}{2}, \frac{1}{3}, \ldots\) up to \(\frac{1}{n}\).

How to Use This Calculator

Enter a positive whole number \(n\) (the number of terms) and the calculator sums \(\frac{1}{k}\) from \(k = 1\) up to \(k = n\). The result is the exact decimal value of \(H(n)\). You can compare it to the approximation \(H(n) \approx \ln(n) + \gamma\), where \(\gamma \approx 0.5772\) is the Euler–Mascheroni constant; this estimate becomes very accurate for large n.

The Formula Explained

The defining formula is $$H(n) = \sum_{k=1}^{n} \frac{1}{k}.$$ There is no simple closed form, so the value is computed term by term. For example, $$H(4) = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} = 1 + 0.5 + 0.333\ldots + 0.25 = 2.08333\ldots$$

Harmonic series area approximated by curve 1/x
The harmonic sum corresponds to the total area of unit-width rectangles under the curve \(y = \frac{1}{x}\).

Worked Example

For \(n = 5\): $$H(5) = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} = 1 + 0.5 + 0.333333 + 0.25 + 0.2 = 2.283333.$$ The calculator returns this directly.

FAQ

Does the harmonic series converge? No. The infinite harmonic series diverges, so \(H(n)\) keeps growing as n grows, though extremely slowly.

What is H(1)? \(H(1) = 1\), since the sum has a single term, \(\frac{1}{1}\).

Why is it called "harmonic"? The name comes from music: the wavelengths of overtones of a vibrating string are \(1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \ldots\) of the fundamental wavelength.

Last updated: