Free Online Math Tool

Harmonic Series Calculator

Calculate harmonic numbers and partial sums of the form Σ(1/k) from a to b. This calculator gives a high-precision decimal result, shows whether exact or asymptotic computation was used, and includes a full guide to the harmonic series, formulas, proofs of divergence, and practical applications.

Calculator

Expression
Σ (1/k), k = 1..100
Result
5.1873775176
Equivalent form
H100
Method
Exact (Kahan summation)
Comparison
ln(b)+γ ≈ 5.1823858509
Enter indices and click calculate. For very large ranges, the calculator automatically switches to an asymptotic formula.

What Is the Harmonic Series?

The harmonic series is one of the most famous infinite series in mathematics. It is the sum of reciprocals of positive integers:

1 + 1/2 + 1/3 + 1/4 + 1/5 + ...

Even though each added term gets smaller and smaller, the total does not settle to a finite limit. This makes the harmonic series a classic example of a divergent series. The finite partial sum up to n terms is called the n-th harmonic number, written as Hn. A harmonic series calculator helps compute these partial sums quickly and accurately, especially when n is large.

How to Use This Harmonic Series Calculator

This calculator supports both full harmonic numbers and custom ranges.

For moderate ranges, the calculator uses a stable exact summation method (Kahan compensation). For very large ranges, it uses an asymptotic harmonic-number formula to avoid slow execution while keeping excellent accuracy.

Harmonic Number Formula and Notation

The n-th harmonic number is:

Hₙ = Σ(1/k), k=1..n

A general range can be written in terms of harmonic numbers:

Σ(1/k), k=a..b = H_b − H_(a−1)

This identity is very useful for analysis, algorithm design, and numerical estimation. It also allows fast approximation when one or both bounds are large.

Why the Harmonic Series Diverges

A common question is: if terms go to zero, why does the sum still diverge? The key is that terms shrink too slowly. Two standard arguments are:

1) Grouping Argument

Group terms like this:

(1) + (1/2) + (1/3+1/4) + (1/5+...+1/8) + ...

Each block after the first has at least 1/2 total. So partial sums keep increasing beyond any fixed bound.

2) Integral Test

Because 1/x is positive and decreasing, compare with ∫(1/x)dx = ln(x). Since ln(x) grows without bound, the harmonic series diverges too.

This divergence is very slow, which is why partial sums can appear “almost convergent” at first glance.

Approximation for Large n

For large n, harmonic numbers are closely approximated by:

Hₙ ≈ ln(n) + γ + 1/(2n) − 1/(12n²) + 1/(120n⁴) − 1/(252n⁶)

Here γ is the Euler–Mascheroni constant (approximately 0.5772156649...). This approximation explains the logarithmic growth of Hn. It is also why many algorithmic average-case complexities involve terms like ln(n) or Hn.

For a range a..b, use:

Σ(1/k), k=a..b ≈ (ln b + γ + ...) − (ln(a−1) + γ + ...)

The γ terms cancel, leaving a logarithmic difference plus correction terms. This yields highly accurate estimates even for very large inputs.

Applications in Math, Computer Science, and Beyond

The harmonic series and harmonic numbers show up in many places:

Because of this broad relevance, a fast and accurate harmonic sum calculator is useful for students, educators, engineers, and researchers.

Worked Examples

Example 1: Compute H10

H10 = 1 + 1/2 + 1/3 + ... + 1/10 = 2.9289682539...

This is a common benchmark for checking harmonic-number implementations.

Example 2: Partial Sum from 50 to 500

Use the range form:

Σ(1/k), k=50..500 = H₅₀₀ − H₄₉

This is exactly what the calculator computes internally when you choose start index 50 and end index 500.

Example 3: Very Large n

For n = 10,000,000, direct summation can be heavy. The asymptotic formula gives a fast, accurate value and is suitable for most practical use cases.

Frequently Asked Questions

Is the harmonic series convergent?

No. The infinite harmonic series diverges, even though its terms approach zero.

What is Hn?

Hn is the n-th harmonic number, the partial sum of the first n reciprocal integers: Hn = Σ(1/k), k=1..n.

How accurate is this harmonic series calculator?

For moderate ranges, it uses compensated exact summation for strong numeric stability. For huge ranges, it applies a high-quality asymptotic expansion with correction terms.

Can I calculate Σ(1/k) for custom bounds?

Yes. Set a and b to any positive integers with a ≤ b. The tool returns Σ(1/k) from k=a to k=b.

Why does Hn look close to ln(n)?

Because Hn = ln(n) + γ + small correction terms. The difference from ln(n) approaches the Euler–Mascheroni constant γ.