# Harmonic Number Calculator

Created by Krishna Nelaturu
Reviewed by Anna Szczepanek, PhD and Rijk de Wet
Last updated: May 09, 2022

Our harmonic number calculator is the perfect solution for anyone seeking to find the $n$-th harmonic number or to calculate the sum of the harmonic series of the first $n$ terms.

It is common to have misconceptions regarding the harmonic number and harmonic series. So we shall discuss some basic concepts on this subject. Specifically, let's answer these questions:

• What is a harmonic number and its equation?
• How do you calculate a harmonic number for integers and non-integers?
• What is the formula for the sum of harmonic series?
• What is the relation between harmonic number and harmonic series?

Whether you're a novice or an advanced reader, we hope that you'll learn something interesting here today. So grab your favorite snacks and explore this topic with us!

## What is a harmonic number? Harmonic number equation

We define the $n$-th harmonic number as the sum of the reciprocals of the first $n$ natural numbers:

\small \begin{align*} H_n &= \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \dotsb + \frac{1}{n}\\ &= \sum_{k=1}^n\frac{1}{k} \end{align*}

where:

• $H_n$ is the $n$-th harmonic number; and
• $n$ is any natural number.

As a consequence of Bernard's postulate, $H_n$ is never an integer unless $n =1$.

🔎 Notice that the harmonic numbers are a rough approximation of the natural logarithm, which is given by $\ln n = \int_1^n \frac{1}{x}dx$. To learn more about the natural logarithm, use our natural log calculator.

## How do you calculate a harmonic number for integers?

To calculate the harmonic number Hₙ for any integer n, use the following steps:

1. Divide 1 by the first n natural numbers and gather them in a sequence to get 1/1, 1/2, 1/3, … 1/n.
2. Add every number in this sequence to get the n-th harmonic number as Hₙ = 1 + 1/2 + 1/3 + … + 1/n.

For example, to calculate the 5th harmonic number $H_5$, we must evaluate the sum:

\small \begin{align*} H_5 &= \sum_{n=1}^5 \frac{1}{n} \\ &= \frac{1}{1} +\frac{1}{2} + \frac{1}{3} + \frac{1}{4}+ \frac{1}{5} \\ &= \frac{137}{60} \approx 2.28333 \end{align*}

Test your understanding of how to find a harmonic number: Calculate the 8th harmonic number $H_8$ yourself using the harmonic number equation. You can verify your answer using our calculator or our FAQ section.

## How do you find the harmonic number of a non-integer?

Strictly speaking, harmonic numbers are defined only for natural numbers. However, we can use the following expression to interpolate harmonic numbers for non-integers:

$\small \psi(n) = H_{n-1} - \gamma$

where:

• $\psi(n)$ is the digamma function; and
• $\gamma$ is the , which is roughly $0.577$.

Let's break this down, starting with the digamma function, which we define as the logarithmic derivative of the gamma function:

$\small \psi(x) = \frac{d}{dx}\ln\left(\Gamma(x)\right) = \frac{\Gamma'(x)}{\Gamma(x)}$

where:

• $\ln(x)$ is the natural logarithmic function; and
• $\Gamma(x)$ is the gamma function.

There are many methods to evaluate this digamma function, but the simplest one we can use is the following expression, which is valid for any complex number $z$ whose real component is positive (i.e., $\Re(z)>0$):

$\small\psi(z) = \sum_{k=0}^{\infty}\frac{z-1}{(k+1)(k+z)}-\gamma$

Re-writing this equation for $z = n + 0i$, where $n$ is an arbitrary positive non-integer, we would get:

$\small\psi(n) = \sum_{k=0}^{\infty}\frac{n-1}{(k+1)(k+n)} -\gamma$

Combining this equation with the initial interpolation relation we've introduced ($\psi(n) = H_{n-1} - \gamma$), we can deduce that

\small\begin{align*} H_{n-1} - \gamma &=\sum_{k=0}^{\infty}\frac{\footnotesize n-1}{\footnotesize (k+1)(k+n)} -\gamma\\ H_{n-1} &= \sum_{k=0}^{\infty}\frac{\footnotesize n-1}{\footnotesize (k+1)(k+n)}\\ \therefore H_n &= \sum_{k=0}^{\infty}\frac{\footnotesize n}{\footnotesize (k+1)(k+n+1)} \end{align*}

And voila! An equation to evaluate harmonic numbers for any non-integer $n$ is at hand! And as we promised, you needn't calculate any extra functions to find the answer. Also, you need not sum this series to infinity — this series will converge after a finite number of iterations.

Now that you've learned how to calculate harmonic numbers, let's find out how they are related to calculating the sum of harmonic series.

## Calculating harmonic series sums and harmonic numbers

The harmonic series is the sum of the reciprocals of all natural numbers, given by:

$\sum_{n=1}^\infty \frac{1}{n}= \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \dotsb$

While its definition is similar to that of a harmonic number, you can see from the formula for the sum of harmonic series it is an infinite series. The harmonic number is considered a partial sum of the harmonic series, where the series contains the reciprocals of the first $n$ natural numbers, instead of all natural numbers.

If you're interested in how harmonic series and music are related, we urge you to check out our harmonic series calculator.

## How to use this harmonic number calculator

This harmonic number calculator is easy to use and is always here to help you. To calculate the harmonic number of a positive number $n$, or to calculate the sum of harmonic series up to the $n$-th term:

1. Enter the positive number in the field labeled n.
2. This calculator will evaluate the $n$-th harmonic number $H_n$ and display it below.
• For integer values of $n$, if $H_n$ has a determinable fraction form, this calculator will provide it alongside its decimal form.
• For non-integer values of $n$, we can only provide $H_n$ in decimal form.

Note that we round all decimal answers to 5 decimal places. Also, to keep the computational time to a minimum, we've capped the maximum value of an integer $n$ at $10^6$, beyond which the algorithm will cause a perceptible lag in most machines. For the same reason, a non-integer $n$ greater than $10^3$ is not allowed.

Don't hesitate to contact us if you want to compute a harmonic number of any number larger than these limits.

## FAQ

### What is the 8ᵗʰ harmonic number?

H₈ = 761/280 = 2.71786. To calculate the 8th harmonic number yourself, follow these instructions:

1. Divide 1 by the first 8 natural numbers and gather them in a sequence to get 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8.
2. Add every number in this sequence to get the n-th harmonic number as Hₙ = 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8 = 761/280 = 2.71786.

### Is the harmonic series a p-series?

Yes. The harmonic series is a special case of p-series given by ∑ 1/nᵖ, where p = 1.

### Does the harmonic series converge?

No, the harmonic series does not converge. The consecutive numbers in the series do not get small fast enough to enable a convergence.

Krishna Nelaturu
nᵗʰ Harmonic number (Hₙ)
n
People also viewed…

### Area of triangle with coordinates

Use this simple tool to calculate the area of a triangle with its coordinates.

### Circle skirt

Circle skirt calculator makes sewing circle skirts a breeze.

### Sunbathing

Do you always remember to put on sunscreen before going outside? Are you sure that you use enough? The Sunbathing Calculator ☀ will tell you when's the time to go back under an umbrella not to suffer from a sunburn!

### Unit rate

The unit rate calculator is here to give you your fraction's equivalent with one in the denominator (i.e. unit rate).