Harmonic Number Calculator
Table of contents
What is a harmonic number? Harmonic number equationHow do you calculate a harmonic number for integers?How do you find the harmonic number of a non-integer?Calculating harmonic series sums and harmonic numbersHow to use this harmonic number calculatorFAQsOur harmonic number calculator is the perfect solution for anyone seeking to find the -th harmonic number or to calculate the sum of the harmonic series of the first 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 -th harmonic number as the sum of the reciprocals of the first natural numbers:
where:
- is the -th harmonic number; and
- is any natural number.
As a consequence of Bernard's postulate, is never an integer unless .
🔎 Notice that the harmonic numbers are a rough approximation of the natural logarithm, which is given by . 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:
- Divide 1 by the first n natural numbers and gather them in a sequence to get: 1/1, 1/2, 1/3, … 1/n.
- Add every number in this sequence to get the n-th harmonic number as Hn = 1 + 1/2 + 1/3 + … + 1/n.
- Verify your answer using our harmonic number calculator.
For example, to calculate the 5th harmonic number , we must evaluate the sum:
Test your understanding of how to find a harmonic number: Calculate the 8th harmonic number 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. We can use them for various purposes, including finding the bessel function values. However, we can use the following expression to interpolate harmonic numbers for non-integers:
where:
- is the digamma function; and
- is the , which is roughly .
Let's break this down, starting with the digamma function, which we define as the logarithmic derivative of the gamma function:
where:
- is the natural logarithmic function; and
- is the gamma function.
Please don't panic — you won't need to evaluate these complicated functions to find our harmonic number. Still, it helps to learn more about this gamma function using our gamma function calculator.
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 whose real component is positive (i.e., ):
Re-writing this equation for , where is an arbitrary positive non-integer, we would get:
Combining this equation with the initial interpolation relation we've introduced (), we can deduce that
And voila! An equation to evaluate harmonic numbers for any non-integer 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:
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 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 , or to calculate the sum of harmonic series up to the -th term:
- Enter the positive number in the field labeled
n
. - This calculator will evaluate the -th harmonic number and display it below.
- For integer values of , if has a determinable fraction form, this calculator will provide it alongside its decimal form.
- For non-integer values of , we can only provide 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 at , beyond which the algorithm will cause a perceptible lag in most machines. For the same reason, a non-integer greater than is not allowed.
Don't hesitate to contact us if you want to compute a harmonic number of any number larger than these limits.
What is the 8ᵗʰ harmonic number?
H₈ = 761/280 = 2.71786. To calculate the 8th harmonic number yourself, follow these instructions:
- 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.
- Add every number in this sequence to get the n-th harmonic number as Hn = 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8 = 761/280 = 2.71786.
- Verify your answer using our harmonic number calculator.
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.