What Is a Harmonic Number?

The n-th harmonic number is formally defined as the sum of the reciprocals of the first n positive integers. Mathematically, this represents a partial sum that appears frequently in analysis and number theory.

A key property discovered by Bertrand's postulate: harmonic numbers are never integers except when n = 1. This means H1 = 1, but every subsequent harmonic number is non-integer. The values grow slowly, approaching the natural logarithm asymptotically with a constant offset related to the Euler–Mascheroni constant.

Harmonic numbers bridge discrete mathematics and continuous analysis, making them indispensable for:

  • Estimating algorithm complexity in computer science
  • Approximating logarithmic functions
  • Studying convergence behaviour of infinite series
  • Calculating special function values

Harmonic Number Formula

The n-th harmonic number Hn is expressed as the sum of unit fractions:

Hn = 1/1 + 1/2 + 1/3 + ... + 1/n = Σ(1/k) for k=1 to n

  • H<sub>n</sub> — The nth harmonic number, the sum of reciprocals of integers from 1 to n
  • n — Any positive integer or non-integer value (for non-integers, approximate using the digamma function)
  • k — Index variable ranging from 1 to n, representing each natural number in the sequence

Computing Harmonic Numbers for Integers

For any positive integer n, calculating the harmonic number is straightforward: generate reciprocals of all integers from 1 to n, then sum them. For example, H8 equals 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8, which simplifies to the fraction 761/280 or approximately 2.71786.

Small harmonic numbers include:

  • H2 = 3/2 ≈ 1.50
  • H3 = 11/6 ≈ 1.833
  • H4 = 25/12 ≈ 2.083
  • H5 = 137/60 ≈ 2.283

As n increases, Hn grows like ln(n) + γ, where γ (gamma) is the Euler–Mascheroni constant approximately equal to 0.5772.

Harmonic Numbers and Non-Integer Values

Strictly speaking, harmonic numbers are defined only for positive integers. However, mathematicians have extended the concept to non-integer arguments using the digamma function ψ(n), which measures the logarithmic derivative of the gamma function.

The relationship is given by: ψ(n) = Hn−1 − γ, where γ ≈ 0.5772 is the Euler–Mascheroni constant. This extension allows interpolation of harmonic-like values for fractional inputs, though the result is no longer a finite sum. This technique is essential in special functions, Bessel function calculations, and advanced statistical applications.

Common Pitfalls and Practical Notes

Be aware of these considerations when working with harmonic numbers.

  1. Integer versus Non-Integer Inputs — The calculator provides exact fractional forms only for integer values of <em>n</em>. Non-integer inputs use digamma approximation and return decimal values only. Always verify the input type expected by your application.
  2. The Harmonic Series Does Not Converge — While individual harmonic numbers are finite, the infinite harmonic series (sum of all reciprocals) diverges. The growth is logarithmic and extremely slow, but it never reaches a limit. This is why harmonic numbers keep increasing indefinitely.
  3. Rounding and Precision Loss — Decimal approximations are typically rounded to 5 decimal places. If exact fractions are required, use the fractional output for integers. For non-integers, digamma approximation introduces unavoidable rounding error.
  4. Relationship to Natural Logarithm — <em>H<sub>n</sub></em> ≈ ln(<em>n</em>) + 0.5772 for large <em>n</em>. This asymptotic approximation is useful for quick estimates but becomes less accurate for small values of <em>n</em> (below 10).

Frequently Asked Questions

What is the difference between a harmonic number and the harmonic series?

A harmonic number <em>H<sub>n</sub></em> is a finite partial sum: the sum of reciprocals of the first <em>n</em> natural numbers. The harmonic series, by contrast, is the infinite sum of all positive reciprocals: 1 + 1/2 + 1/3 + 1/4 + ... continuing indefinitely. Every harmonic number is a partial sum of the harmonic series, stopping at a specific term <em>n</em>. The key distinction: harmonic numbers are bounded values; the harmonic series diverges without limit.

Why is H₈ equal to 761/280?

The 8th harmonic number is computed by summing: 1/1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8. To combine these fractions, find the least common multiple of denominators 1 through 8, which is 840. Converting each fraction to this denominator and summing gives 2520/840. Reducing by the greatest common divisor (2) yields 761/280, or approximately 2.71786 in decimal form.

Can harmonic numbers be calculated for decimal or fractional inputs?

Technically, harmonic numbers are defined only for positive integers. However, mathematicians extend the concept to non-integer values using the digamma function, a generalization based on the gamma function. The digamma approximation allows harmonic-like values for fractional inputs, though the result is an interpolation rather than a true sum. This extension is useful in advanced mathematics and statistical computations but lacks the elegant fractional form available for integers.

How fast does the harmonic series grow?

Harmonic numbers grow extremely slowly, following a logarithmic pattern. For large <em>n</em>, <em>H<sub>n</sub></em> is approximately ln(<em>n</em>) + γ, where γ ≈ 0.5772. This means to reach a harmonic number of just 10, you need roughly e⁹ ≈ 8,000 terms. To reach 20, you need about e¹⁹ terms—an astronomically large number. This logarithmic growth is why the harmonic series diverges so slowly and why early terms contribute disproportionately large amounts.

Is the harmonic series a type of p-series?

Yes, the harmonic series is a special case of the p-series family, defined as Σ(1/n<sup>p</sup>) for <em>p</em> > 0. The harmonic series corresponds to <em>p</em> = 1. In general, p-series converge when <em>p</em> > 1 and diverge when <em>p</em> ≤ 1. Since the harmonic series has <em>p</em> = 1, it sits exactly at the boundary of convergence and diverges, albeit very slowly.

How is the Euler–Mascheroni constant related to harmonic numbers?

The Euler–Mascheroni constant γ ≈ 0.5772 appears in the asymptotic expansion of harmonic numbers. For large <em>n</em>, <em>H<sub>n</sub></em> ≈ ln(<em>n</em>) + γ + 1/(2<em>n</em>) − 1/(12<em>n</em>²) + ... The constant represents the limiting difference between the harmonic number and the natural logarithm. It also appears in the digamma function, used to extend harmonic numbers to non-integer values. Despite its importance, γ remains irrational (and possibly transcendental), making it difficult to express in closed form.

More math calculators (see all)