Search for a tool
Harmonic Number

Tool for calculating the values of the harmonic numbers, ie the values of the nth partial sums of the harmonic series as well as their inverse. 1 + 1/2 + 1/3 + … + 1/n

Results

Harmonic Number -

Tag(s) : Series

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Harmonic Number' tool for free! Thank you!

Harmonic Number

Nth Harmonic Number Calculator

$$ H(N) = 1+1/2+1/3+…+1/N $$

Reciprocal Harmonic Value

$$ H(N) = x \iff N = ? $$

Answers to Questions (FAQ)

What is a harmonic number? (Definition)

Harmonic numbers are real numbers present in the harmonic series $ H_n $ (which uses the sum of the inverse of non-zero natural integers).

How to calculate a harmonic number?

Apply the harmonic formula $$ H_n = \sum_{k=1}^n \frac{1}{k} = 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{n} $$

Example: $ H_2 = 1+\frac{1}{2} = \frac{3}{2} = 1.5 $

The following recurrence formula can also be applied to get a series:

$$ H_n = H_{n-1} + \frac{1}{n} $$

When $ n $ is very big, an approximation based on the natural logarithm can be useful to speed up the calculations:

$$ \lim_{n \to \infty} H_n = \ln n + \gamma $$

with $ \gamma \approx 0.577215665 $ the Euler–Mascheroni constant.

There is also a formula based on a integrate calculation: $$ H_n = \int_0^1 \frac{1 - x^n}{1 - x}\,dx $$

What are the first values of the Harmonic Series?

The first harmonic numbers are:

nH(n)≈H(n)
1st harmonic number1/11
2nd harmonic number3/21.5
3rd harmonic number11/61.83333
4th harmonic number25/122.08333
5th harmonic number137/602.28333
6th harmonic number49/202.45
7th harmonic number363/1402.59286
8th harmonic number761/2802.71786
9th harmonic number7129/25202.82896
10th harmonic number2.92897
100th harmonic number5.18738
1000th harmonic number7.48547
10000th harmonic number9.78761
100000th harmonic number12.09015
1000000th harmonic number14.39272
10000000th harmonic number16.69531
100000000th harmonic number18.99790
1000000000th harmonic number21.30048

Is the Harmonic Series convergent?

No, the harmonic series is an example of a divergent series, the sum of the terms of the series has no finite limit and tends towards infinity.

What is the relationship between harmonic numbers and the Riemann Zeta function?

The Harmonic series with $ n \to \infty $ is a special case of the Riemann Zeta function ζ(s), when $ s = 1 $.

How to implement the Harmonic series?

The algorithm for calculating harmonic numbers can use a summation loop // Pseudo-code
function harmonicNumber(N) {
harmonic = 0
for (i = 1; i <= N; i++) {
harmonic = harmonic + 1 / i
}
return harmonic
}

Source code

dCode retains ownership of the "Harmonic Number" source code. Any algorithm for the "Harmonic Number" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Harmonic Number" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Harmonic Number" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Harmonic Number" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/harmonic-number
In a scientific article or book, the recommended bibliographic citation is: Harmonic Number on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/harmonic-number

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Harmonic Number' tool for free! Thank you!


https://www.dcode.fr/harmonic-number
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback