---
slug: harmonic-number-calculator
title: "Harmonic Number Calculator"
category: math
updated: 2026-11-18
canonical: https://calcseed.com/c/math/harmonic-number-calculator/
html: /c/math/harmonic-number-calculator/
---

# Harmonic Number Calculator

Compute a harmonic sum: 1/k added from a starting index up to n.

## Quick answer

**Quick answer:** with the default inputs (1, 10), the harmonic number is **2.93**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Start (k) | 1 |  |
| n | 10 |  |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Harmonic number | 2.92897 |  |

## Formula

```text
H(n) = 1 + 1/2 + 1/3 + &hellip; + 1/n
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Start (k) | number |  | 1 |
| n | number |  | 10 |

## Outputs

| Result | Format |
| --- | --- |
| Harmonic number | primary |
| Harmonic number | number |

## How it works

### What a harmonic number is

The nth harmonic number adds the reciprocals of every integer from a start index up to n. With start = 1 this is the classic H(n) = 1 + 1/2 + 1/3 + &hellip; + 1/n, and at the default n = 10 the sum is **2.93** (exactly 7381/2520). The start input also produces partial harmonic sums: from k = 5 to n = 10, for example, the calculator returns 1/5 + 1/6 + &hellip; + 1/10 ≈ 0.845635.

### How the sum behaves

Each added term shrinks, so the total grows more slowly than any linear series, yet it never stops growing: the harmonic series diverges, creeping upward like ln n. The approximation H(n) ≈ ln n + 0.5772 is already close at n = 10, where it predicts 2.8798 against the true 2.928968, and by n = 1,000 it predicts 7.4849 against the true 7.485471. The constant 0.5772 is the Euler–Mascheroni constant, the limit of H(n) − ln n.

The slow divergence has a practical consequence: to gain one more unit of sum you need roughly 2.7× as many terms each time. H(n) first passes 5 at n = 83, passes 10 only at n = 12,367, and would need about 10^43 terms to reach 100. Doubling n adds a little over 0.69 (ln 2) to the sum, so H(20) ≈ H(10) + 0.693 ≈ 3.5975, and the true value 3.597740 matches.

### Worked example with the default inputs

Add the ten reciprocals in order: 1/1 = 1; +1/2 = 1.5; +1/3 ≈ 1.833333; +1/4 = 2.083333; +1/5 = 2.283333; +1/6 ≈ 2.45; +1/7 ≈ 2.592857; +1/8 = 2.717857; +1/9 ≈ 2.828968; +1/10 = **2.928968**, displayed as 2.93. In fractions, the exact value is 7381/2520, and the decimal repeats with period 12 because the denominator 2520 = 2^3 × 3^2 × 5 × 7.

Setting start = 5 and n = 10 trims the first four terms from that total: 2.928968 − (1 + 0.5 + 0.333333 + 0.25) = 2.928968 − 2.083333 = 0.845635. That equals 1/5 + 1/6 + 1/7 + 1/8 + 1/9 + 1/10, which is how a partial sum works: subtract nothing yourself, just enter the range.

### Harmonic numbers at a glance

| n | H(n) | ln n + 0.5772 (approx) |
| --- | --- | --- |
| 1 | 1 | 0.577 |
| 5 | 2.283333 | 2.186 |
| 10 | 2.928968 | 2.880 |
| 100 | 5.187378 | 5.182 |
| 100,000 | 12.090146 | 12.090 |

The gap between the true value and the approximation shrinks like 1/(2n): about 0.049 at n = 10, 0.0050 at n = 100, and negligible at 100,000. For quick mental estimates past n = 100, ln n + 0.5772 is accurate to three decimal places.

### Where harmonic numbers appear

- The coupon-collector problem: collecting all n distinct coupons takes about n × H(n) draws on average, so n = 10 needs roughly 29.3 draws, and n = 100 needs about 518.7.
- Algorithm analysis: quicksort and binary search tree costs average 2(n + 1)H(n) − 4n comparisons, so H(n) appears in every precise average-case bound.
- Probabilistic estimates: the expected number of records in a random sequence of length n is exactly H(n), so about 2.93 record values appear among 10 random draws.
- Physics and engineering: the divergent ladder of resonant modes and the counting of logarithmic growth in data structures both reduce to harmonic sums.

#### Why the series diverges but terms shrink

Group the terms in doubling blocks: 1/2 alone, then 1/3 + 1/4 > 1/2, then 1/5 through 1/8 exceeds 4 × 1/8 = 1/2, and each block from 1/(2^k+1) to 1/2^k+1 exceeds 1/2. Every block adds at least half a unit, so the sum passes every bound eventually. The individual terms still vanish, which is why the growth is logarithmic rather than linear.

### Common mistakes

- Confusing the harmonic number with the harmonic mean: H(10) = 2.93 sums reciprocals directly, while the harmonic mean calculator divides the count by a reciprocal sum. Same building blocks, different outputs.
- Assuming convergence: no value of n stops the growth. H(10) = 2.93 and H(100) = 5.19 differ by 2.26 despite each added term being under 0.01 by the end.
- Using the ln approximation for small n: at n = 5 it is off by almost 0.1, which matters in probability answers. The approximation is safe from about n = 20 upward.
- Setting start above n: the calculator clamps n up to the start, so a start of 20 with n = 5 returns just 1/20 = 0.05 rather than an error.

### Limits and precision

Both inputs accept values up to 100,000, where the sum reaches 12.090146. Floating-point addition accumulates rounding across 100,000 terms, but the error stays below the sixth displayed decimal because each addition is small relative to the running total. For exact rational results, note that H(n) as a fraction has a denominator that is the least common multiple of 1 through n, which explodes factorially; 2.93 is the practical form for n = 10 and beyond.

### Partial sums versus the full series

#### The identity that ties ranges together

The start input turns one tool into many. start = 1, n = 5 gives the standard H(5) = 2.283333; start = 6, n = 10 gives the back half, 0.645635; and start = n collapses to a single term 1/n. A useful identity ties them together: any partial sum from a to b equals H(b) − H(a − 1), so the range 5–10 equals H(10) − H(4) = 2.928968 − 2.083333 = 0.845635, matching the direct computation.

## FAQ

### What is H(10), the 10th harmonic number?

H(10) = 1 + 1/2 + &hellip; + 1/10 = 2.928968, displayed as 2.93. The exact fraction is 7381/2520.

### Does the harmonic series converge?

No. The sum grows without bound, roughly like ln n: H(10) ≈ 2.93, H(100) ≈ 5.19, H(100,000) ≈ 12.09, and it passes 10 only at n = 12,367.

### How large can n be?

The calculator accepts n up to 100,000, where the sum is 12.090146. That covers most practical uses in probability and algorithm analysis.

### What is H(1)?

H(1) = 1, since the sum contains only 1/1. Setting both start and n to 1 in the calculator returns exactly 1.

### How do I sum reciprocals from 5 to 10 instead of 1 to 10?

Set start = 5 and n = 10. The result is 0.845635, which equals H(10) − H(4) = 2.928968 − 2.083333, matching the identity for partial sums.

### What approximation estimates H(n) quickly?

H(n) ≈ ln n + 0.5772, where 0.5772 is the Euler–Mascheroni constant. It predicts 2.880 at n = 10 against a true 2.928968, and by n = 100 the gap shrinks to about 0.005.

### How does this relate to the coupon-collector problem?

Expected draws to collect all n coupons is about n × H(n). For n = 10 that is 10 × 2.928968 ≈ 29.3 draws, and for n = 100 it is about 519.

### Why does the sum grow so slowly?

Each term 1/k shrinks, and the running total rises only by ln 2 ≈ 0.69 each time n doubles. H(20) = 3.597740 against H(10) = 2.928968 shows the 0.69 jump directly.

## Method and sources

Methodology: Results follow exact mathematical definitions; the arithmetic is deterministic and can be verified by hand from the steps shown.

Last updated: 2026-11-18.
- Harmonic number definition H(n) = sum of 1/k for k = 1 to n.
