Harmonic Sum Calculator

Harmonic numbers Hₙ as exact fractions, ln n + γ estimates and generalized Hₙ⁽ᵖ⁾.

  1. Enter valuesUse your own inputs or an example
  2. CalculateApply your selected settings
  3. View resultExplore the answer and explanation

Enter the harmonic sum

Enter your values below to get started.

Examples:
Hₙ = 1 + 1/2 + … + 1/n
1 = harmonic; 2 = Σ 1/k²
Leave 1 for Hₙ.
Reset restores the default values.

Tips for this calculator

Hₙ grows like ln n: doubling n adds about ln 2 ≈ 0.693.

The calculator shows an exact fraction for blocks of up to 3,001 terms with whole-number p.

Set p = 2 to see Σ 1/k² approach π²/6 ≈ 1.644934.

Set m to sum a block of terms, such as 1/(n + 1) + … + 1/(2n).

A harmonic sum calculator adds the reciprocals of the whole numbers, Hₙ = 1 + 1/2 + 1/3 + … + 1/n. Enter n to get the harmonic number as an exact fraction and a decimal, the approximation ln n + γ, a partial harmonic sum from k = m to n, or the generalized harmonic number Hₙ⁽ᵖ⁾ = Σ 1/kᵖ for any order p.

What is a Harmonic Sum?

A harmonic sum is the sum of the reciprocals of the first n positive whole numbers, Hₙ = 1 + 1/2 + 1/3 + … + 1/n, and its value is called the nth harmonic number. The first 4 harmonic numbers are 1, 3/2, 11/6 and 25/12.

Hn=∑k=1n1k=1+12+13+⋯+1nH_n = \sum_{k=1}^{n} \frac{1}{k} = 1 + \frac12 + \frac13 + \cdots + \frac1n

The name comes from music. A vibrating string sounds its kth harmonic when it vibrates in k equal loops, each 1/k of the string, so the lengths 1, 1/2, 1/3, … are the terms of the harmonic series. Pythagoras (about 570–495 BC) linked these length ratios to musical intervals.

InteractiveString harmonics: lengths 1, 1/2, 1/3, …

How Does the Harmonic Sum Calculator Work?

The harmonic sum calculator adds the fractions exactly with whole-number arithmetic for short sums and adds decimals from the smallest term to the largest for long sums. Past 2,000,000 terms it adds 200,001 terms directly and the rest with the Euler–Maclaurin formula, which keeps the error below 10⁻¹² for n up to 10¹⁵.

InteractiveExact fraction vs. the logarithm approximation
  1. Read n, p and m

    n is the last term, p the power on k (1 for the harmonic series) and m the first k.

  2. Add exactly

    For up to 3,001 terms and whole-number p, the fractions are added with a common denominator, so H₁₀ = 7381/2520.

  3. Add numerically

    Longer sums are added from 1/n back to 1/m to limit rounding error.

  4. Compare with ln n + γ

    For p = 1 the calculator shows the approximation ln n + γ + 1/(2n) − 1/(12n²) and its error.

Harmonic Sum Formula

The harmonic sum has no closed form with elementary functions, but Hₙ ≈ ln n + γ + 1/(2n) − 1/(12n²) gives 9 correct digits for n = 100. The constant γ ≈ 0.5772156649 is the Euler–Mascheroni constant, named after Leonhard Euler and Lorenzo Mascheroni.

Harmonic Number Definition

Hn=∑k=1n1kH_n = \sum_{k=1}^{n} \frac1k

Asymptotic Formula

Hn=ln⁡n+γ+12n−112n2+1120n4−⋯H_n = \ln n + \gamma + \frac{1}{2n} - \frac{1}{12n^2} + \frac{1}{120n^4} - \cdots

Partial Harmonic Sum

∑k=mn1k=Hn−Hm−1≈ln⁡nm−1\sum_{k=m}^{n} \frac1k = H_n - H_{m-1} \approx \ln\frac{n}{m-1}

Generalized Harmonic Number

Hn(p)=∑k=1n1kp,lim⁡n→∞Hn(p)=ζ(p) for p>1H_n^{(p)} = \sum_{k=1}^{n} \frac{1}{k^{p}}, \qquad \lim_{n\to\infty} H_n^{(p)} = \zeta(p)\ \text{for } p > 1
InteractiveFormula playground: pick n and p

Types of Harmonic Series

There are 4 types of harmonic series: the harmonic series, the alternating harmonic series, the generalized harmonic series (p-series) and the partial harmonic sum. Only the alternating series and p-series with p > 1 converge.

InteractiveHarmonic, alternating and p-series side by side

Harmonic series

1 + 1/2 + 1/3 + … diverges, growing like ln n.

Alternating harmonic series

1 − 1/2 + 1/3 − 1/4 + … converges to ln 2 ≈ 0.6931.

p-series (generalized)

Σ 1/kᵖ converges for p > 1: p = 2 gives π²/6, p = 3 gives Apéry's constant ζ(3) ≈ 1.2021. It diverges for p ≤ 1.

Partial harmonic sum

1/m + … + 1/n ≈ ln(n/(m − 1)). The block 1/(n + 1) + … + 1/(2n) approaches ln 2.

How to Calculate a Harmonic Sum by Hand

To calculate a harmonic sum by hand, find the least common multiple (LCM) of 1 to n, rewrite each 1/k over that denominator, add the numerators and reduce. The process takes 4 steps. Here is H₅.

  1. LCM of 1, 2, 3, 4, 5 = 60.
  2. Rewrite: 60/60 + 30/60 + 20/60 + 15/60 + 12/60.
  3. Add numerators: 60 + 30 + 20 + 15 + 12 = 137.
  4. H₅ = 137/60 ≈ 2.2833 (already in lowest terms).
InteractiveStep through a harmonic sum by hand

    Why the Harmonic Series Diverges

    The harmonic series diverges: its terms split into infinitely many blocks that each add to at least 1/2. French philosopher Nicole Oresme gave this proof around 1350: 1/3 + 1/4 ≥ 1/2, 1/5 + … + 1/8 ≥ 1/2, 1/9 + … + 1/16 ≥ 1/2, and so on, so H2ᵍ ≥ 1 + g/2.

    The growth is slow. H₁₀₀ ≈ 5.19 and H₁,₀₀₀,₀₀₀ ≈ 14.39. The sum first passes 3 at n = 11, passes 5 at n = 83 and passes 10 at n = 12,367. The terms 1/k shrink to 0, which shows that terms tending to 0 do not guarantee convergence.

    InteractiveOresme's grouping: every block adds at least ½

    Common Mistakes with Harmonic Sums

    • Assuming the harmonic series converges: 1/k → 0, but Hₙ grows without bound.
    • Using ln n alone: ln 10 ≈ 2.303 is 0.63 below H₁₀ ≈ 2.929; add γ ≈ 0.5772 and 1/(2n).
    • Mixing up p-series limits: Σ 1/k² = π²/6 ≈ 1.645, not 2.
    • Using a product of denominators: the common denominator of H₄ is LCM(1, 2, 3, 4) = 12, not 24.
    • Rearranging the alternating series: 1 − 1/2 + 1/3 − … = ln 2 only in the given order (Riemann series theorem).
    InteractiveTrue or false: harmonic sums
    1. The harmonic series 1 + 1/2 + 1/3 + … converges.

    2. H₄ = 25/12.

    3. Σ 1/k² from 1 to ∞ equals 2.

    4. Hₙ − ln n approaches the Euler–Mascheroni constant γ ≈ 0.5772.

    5. The alternating harmonic series 1 − 1/2 + 1/3 − … converges to ln 2.

    Score: 0 / 5

    How to Use the Harmonic Sum Calculator

    Enter n, keep p = 1 and m = 1 for the harmonic number Hₙ, and press Calculate. Change p for a generalized harmonic number or m for a block of terms. The result shows the exact fraction, the decimal, the ln n + γ estimate, a term table and a graph.

    InteractiveLoad a ready-made harmonic sum

    Each button fills the calculator and runs it.

    1. Enter n

      Any whole number from 1 to 10¹⁵.

    2. Set the order p

      1 for 1/k, 2 for 1/k², 0.5 for 1/√k.

    3. Set the start m

      1 for Hₙ; a larger m sums 1/m + … + 1/n.

    4. Read the result

      Open the Graph tab to compare the partial sums with ln k + γ.

    Real-Life Applications of Harmonic Sums

    Harmonic sums appear wherever a quantity is shared 1, 2, 3, … ways. There are 5 common applications:

    • Book stacking: n books stacked with the best offsets overhang the table edge by Hₙ/2 book lengths; 4 books reach 25/24, more than 1 full book.
    • Coupon collector problem: collecting all n different coupons takes n·Hₙ random draws on average; 50 coupons take about 225 draws.
    • Computer science: quicksort makes about 2n·Hₙ ≈ 1.39 n log₂ n comparisons on average.
    • Music: overtones of a string or pipe sit at 1/2, 1/3, 1/4 of the fundamental length.
    • Electric circuits: resistors of 1, 2, …, n ohms (Ω) in parallel have conductance Hₙ siemens (S).
    InteractiveBook stacking: overhang = Hₙ / 2

    Harmonic Sum Examples

    Common harmonic and generalized harmonic sums with exact and decimal values.

    Harmonic Sum Examples
    SumExactDecimalCalculator
    H5H_5137/602.283333
    H10H_{10}7381/25202.928968
    H20H_{20}55835135/155195043.597740
    H100H_{100}–5.187378
    H1000H_{1000}–7.485471
    H106H_{10^6}–14.392727
    ∑k=1101k2\sum_{k=1}^{10} \frac{1}{k^2}1968329/12700801.549768
    ∑k=11201k\sum_{k=11}^{20} \frac1k155685007/2327925600.668771

    Popular Harmonic Sum Problems

    Try each one, then reveal the answer or solve it in the calculator.

    1. Find H₆ as a fraction.

      H_6 = 1 + \tfrac12 + \cdots + \tfrac16
      Show answerH_6 = \frac{49}{20}
    2. Find H₈ as a fraction.

      H_8
      Show answerH_8 = \frac{761}{280}
    3. Estimate H₅₀ and the coupon collector's expected draws for 50 coupons.

      H_{50},\ 50\,H_{50}
      Show answerH_{50} \approx 4.4992,\ 50H_{50} \approx 224.96
    4. Find Σ 1/k³ for k = 1 to 5.

      \sum_{k=1}^{5} \frac{1}{k^3}
      Show answer\frac{256103}{216000} \approx 1.18566
    5. Find 1/3 + 1/4 + 1/5 + 1/6.

      \sum_{k=3}^{6} \frac1k
      Show answer\frac{19}{20}
    6. Show that H₁₁ is the first harmonic number above 3.

      H_{10},\ H_{11}
      Show answerH_{11} = \frac{83711}{27720} \approx 3.0199

    Explore More Sum Calculators

    Discover 67 free sum calculators across different categories. Find the right calculator for your needs.

    Browse All 67 Calculators
    Questions and answers

    Frequently Asked Questions

    What is a harmonic sum calculator?

    A harmonic sum calculator is an online tool that adds 1 + 1/2 + 1/3 + … + 1/n. It returns the harmonic number Hₙ as an exact fraction and a decimal, the ln n + γ approximation, partial sums from m to n and generalized sums Σ 1/kᵖ.

    What is the formula for the nth harmonic number?

    The nth harmonic number is Hₙ = Σ 1/k for k = 1 to n. There is no elementary closed form; Hₙ ≈ ln n + γ + 1/(2n) − 1/(12n²) with γ ≈ 0.5772.

    Does the harmonic series converge?

    No, the harmonic series does not converge. Its partial sums grow like ln n without bound, as Nicole Oresme proved around 1350.

    What is the sum of 1/n² from 1 to infinity?

    The sum of 1/n² from 1 to infinity is π²/6 ≈ 1.644934. Leonhard Euler solved this Basel problem in 1734.

    What is H₁₀?

    H₁₀ = 7381/2520 ≈ 2.928968, the sum 1 + 1/2 + … + 1/10.

    How many terms of the harmonic series exceed 10?

    The harmonic series first exceeds 10 at n = 12,367 terms. H₁₂,₃₆₆ ≈ 9.99996 and H₁₂,₃₆₇ ≈ 10.00004.

    Is the alternating harmonic series convergent?

    Yes, the alternating harmonic series 1 − 1/2 + 1/3 − … converges to ln 2 ≈ 0.6931 by the alternating series test.

    What is the Euler–Mascheroni constant?

    The Euler–Mascheroni constant γ ≈ 0.5772156649 is the limit of Hₙ − ln n as n → ∞. Nobody has proved whether γ is rational or irrational.

    Is a harmonic number ever a whole number?

    No, a harmonic number Hₙ is never a whole number for n > 1. The denominator always keeps the factor of the largest power of 2 up to n.

    Conclusion

    A harmonic sum adds the reciprocals 1 + 1/2 + … + 1/n, and the harmonic sum calculator returns that harmonic number exactly, as a decimal and against the estimate ln n + γ. The harmonic series diverges, but slowly; its p-series cousins converge for every p > 1.

    Not sure which setting matches your problem? Answer the questions below.

    InteractiveWhich harmonic sum do you need?