# Harmonic Number

The harmonic numbers are the partial sums of the harmonic series. They appear in many expressions involving special functions in analytic number theory, including the Riemann zeta function. They are also related closely to the natural logarithm.

## Definition

The \(n\)th harmonic number \( H_n\) is the sum of the reciprocals of the first \(n\) natural numbers:

\[H_n=\sum_{k=1}^{n} \dfrac{1}{k} = \dfrac{1}{1} + \dfrac{1}{2} + \dfrac{1}{3} + \dfrac{1}{4} + \dots + \dfrac{1}{n} \]

**True or false:**

\[{1729}H_{{1728}}-{1728}={1729}H_{{1729}}-{1729}.\]

**Notation**: \(H_n\) denote the \(n^\text{th}\) harmonic number, \(H_n = 1 + \dfrac12 + \dfrac13 + \cdots + \dfrac1n \).

## Properties

Note that \( H_n\) is a (left) Riemann sum for the integral \( \int_1^{n+1} \frac1{x} \, dx =\ln(n+1).\) So \( H_n\) is roughly equal to \( \ln(n).\) In fact, the difference between \( H_n\) and \( \ln(n)\) tends to a constant called the Euler-Mascheroni constant.

\( H_n\) is a rational number. But

\(H_n\) is never an integer for \( n>1.\)

Write \( H_n = \frac{a_n}{n!}.\) Then \( a_n\) is a sum of all the products of \( n-1\) distinct integers between \( 1\) and \(n\) inclusive. By Bertrand's postulate, there is a prime \( p\) in the interval \( (n/2,n],\) for \( n \ge 2.\) Then \( p\) divides exactly one of the integers between \( 1\) and \(n\) inclusive, namely \(p\) itself (because \( 2p >n.)\) So \( a_n\) is a sum of all the products containing \( p\) plus one that does not, which is not divisible by \( p.\) So \( p \not\mid a_n,\) but \( p|n!,\) so \( H_n\) cannot be an integer because its denominator when it is reduced to lowest terms will contain a factor of \( p.\)

The proof predicts that \( H_6\) will contain a factor of \( 5 \) in its denominator; indeed, \[ H_6 = \frac{720+360+240+180+144+120}{720} \] and it is clear that the denominator is divisible by \( 5\) but the numerator is not.

## Applications

The harmonic numbers appear in expressions for integer values of the digamma function: \[ \psi(n) = H_{n-1} - \gamma.\]

The harmonic numbers are used in the definition of the Euler-Mascheroni constant γ: \[ \gamma = \lim_{n \to \infty}{\left(H_n - \ln(n)\right)}. \]

The harmonic numbers are used in an elementary reformulation (due to Lagarias) of the Riemann hypothesis: it is equivalent to the statement that
\[

\sigma(n) \le H_n + \ln(H_n)e^{H_n}
\]
for all integers \(n \ge 1,\) with strict inequality if \( n>1,\) where \( \sigma(n)\) denotes the sum of the positive divisors of n.

## Integral representation

An integral representation for \( H_n\) given by Euler is:

\[ H_n = \int_0^1 \frac{1 - x^n}{1 - x}\,dx. \]

(This is clear, since \( \frac{1-x^n}{1-x} = 1+x+x^2+\cdots+x^{n-1}.)\)

This can be used to find an alternating series representation of \( H_n\) using the substitution \(x = 1−u\):

\[ \begin{align} H_n &= \int_0^1 \frac{1 - x^n}{1 - x}\,dx \\ &=-\int_1^0\frac{1-(1-u)^n}{u}\,du \\ &= \int_0^1\frac{1-(1-u)^n}{u}\,du \\ &= \int_0^1\left[\sum_{k=1}^n(-1)^{k-1}\binom nk u^{k-1}\right]\,du \\ &= \sum_{k=1}^n (-1)^{k-1}\binom nk \int_0^1u^{k-1}\,du \\ &= \sum_{k=1}^n(-1)^{k-1}\frac{1}{k}\binom nk . \end{align} \]

## Generating function

The generating function for the harmonic numbers has a relatively simple closed form: \[ \sum_{n=1}^\infty H_nx^n = \frac{-\ln(1-x)}{1-x} \] for \(-1\leq x<1.\)

\[ \begin{align} \sum_{n=1}^\infty H_nx^n &= \sum_{n=1}^\infty \sum_{k=1}^n \frac1{k} x^n \\ &= \sum_{k=1}^\infty \frac1{k} (x^k+x^{k+1}+\cdots) \\ &= \sum_{k=1}^\infty \frac1{k} \frac{x^k}{1-x} \\ &= \frac1{1-x} \sum_{k=1}^\infty \frac{x^k}{k} \\ &= \frac{-\ln(1-x)}{1-x} \end{align} \] using the Maclaurin series for \(\ln(1-x).\)

Let \( H_n = 1+\dfrac12 + \dfrac13 + \cdots + \dfrac1{n}\) be the \(n^\text{th}\) harmonic number.

The sum \[ \sum_{n=1}^\infty \frac{H_n}{2^n} = \ln (a) \] for some positive integer \( a\). What is \( a\)?