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. The harmonic series is the series of inverses of natural non-zero integers. 1 + 1/2 + 1/3 + ... + 1/n

Harmonic Number - dCode

Tag(s) : Series

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*!

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. The harmonic series is the series of inverses of natural non-zero integers. 1 + 1/2 + 1/3 + ... + 1/n

**Harmonic numbers** are described by the formula: (sum of inverses of natural numbers)

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

__Example:__ $ H_3 = 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} $$

$ H_n $ is called the **Harmonic series**.

When $ n $ is very big, the following approximation using logarithm can be applied

$$ \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 $$

The first **harmonic numbers** are:

n | H(n) | ≈H(n) |
---|---|---|

1 | 1/1 | 1 |

2 | 3/2 | 1.5 |

3 | 11/6 | 1.83333 |

4 | 25/12 | 2.08333 |

5 | 137/60 | 2.28333 |

6 | 49/20 | 2.45 |

7 | 363/140 | 2.59286 |

8 | 761/280 | 2.71786 |

9 | 7129/2520 | 2.82896 |

10 | 2.92897 | |

100 | 5.18738 | |

1000 | 7.48547 | |

10000 | 9.78761 | |

100000 | 12.09015 | |

1000000 | 14.39272 | |

10000000 | 16.69531 | |

100000000 | 18.99790 | |

1000000000 | 21.30048 |

dCode retains ownership of the online 'Harmonic Number' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (PHP, Java, C#, Python, Javascript, Matlab, etc.) no data, script or API access will be for free, same for Harmonic Number download for offline use on PC, tablet, iPhone or Android !

Please, check our community Discord for help requests!

series,harmonic,number,inverse,euler

Source : https://www.dcode.fr/harmonic-number

© 2020 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.

Feedback

▲