right|thumb|400px|The harmonic number <math>H_n</math> with <math>n=\lfloor x \rfloor</math> (red line) with its asymptotic limit <math>\gamma+\ln(x)</math> (blue line) where <math>\gamma</math> is the [[Euler–Mascheroni constant.]]

In mathematics, the -th harmonic number is the sum of the reciprocals of the first natural numbers:

<math display="block">H_n= 1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n} =\sum_{k=1}^n \frac{1}{k}.</math>

Starting from , the sequence of harmonic numbers begins:

<math display="block">1, \frac{3}{2}, \frac{11}{6}, \frac{25}{12}, \frac{137}{60}, \dots</math>

Harmonic numbers are related to the harmonic mean in that the -th harmonic number is also times the reciprocal of the harmonic mean of the first positive integers.

Harmonic numbers have been studied since antiquity and are important in various branches of number theory. They are sometimes loosely termed harmonic series, are closely related to the Riemann zeta function, and appear in the expressions of various special functions.

The harmonic numbers roughly approximate the natural logarithm function The Bertrand-Chebyshev theorem can also be used to show that the denominator of the th harmonic number is divisible by the largest prime not larger than .

List

{| class="wikitable"

|+The first 40 harmonic numbers, H<sub>n</sub>

! rowspan=2 |n

|-%

! H<sub>n</sub> a fraction !! decimal H<sub>n</sub> !! relative size

|-

| style="text-align:right;"|1 || style="text-align:center;" |1 ||

|-

| style="text-align:right;"|2 || style="text-align:center;"|3 / 2 ||

|-

| style="text-align:right;"|3 || style="text-align:center;"|11 / 6 || ~

|-

| style="text-align:right;"|4 || style="text-align:center;"|25 / 12 || ~

|-

| style="text-align:right;"|5 || style="text-align:center;"|137 / 60 || ~

|-

| style="text-align:right;"|6 || style="text-align:center;"|49 / 20 ||

|-

| style="text-align:right;"|7 || style="text-align:center;"|363 / 140 || ~

|-

| style="text-align:right;"|8 || style="text-align:center;"|761 / 280 || ~

|-

| style="text-align:right;"|9 || style="text-align:center;"|7&thinsp;129 / 2&thinsp;520 || ~

|-

| style="text-align:right;"|10 || style="text-align:center;"|7&thinsp;381 / 2&thinsp;520 || ~

|-

| style="text-align:right;"|11 || style="text-align:center;"|83&thinsp;711 / 27&thinsp;720 || ~

|-

| style="text-align:right;"|12 || style="text-align:center;"|86&thinsp;021 / 27&thinsp;720 || ~

|-

| style="text-align:right;"|13 || style="text-align:center;"|1&thinsp;145&thinsp;993 / 360&thinsp;360 || ~

|-

| style="text-align:right;"|14 || style="text-align:center;"|1&thinsp;171&thinsp;733 / 360&thinsp;360 || ~

|-

| style="text-align:right;"|15 || style="text-align:center;"|1&thinsp;195&thinsp;757 / 360&thinsp;360 || ~

|-

| style="text-align:right;"|16 || style="text-align:center;"|2&thinsp;436&thinsp;559 / 720&thinsp;720 || ~

|-

| style="text-align:right;"|17 || style="text-align:center;"|42&thinsp;142&thinsp;223 / 12&thinsp;252&thinsp;240 || ~

|-

| style="text-align:right;"|18 || style="text-align:center;"|14&thinsp;274&thinsp;301 / 4&thinsp;084&thinsp;080 || ~

|-

| style="text-align:right;"|19 || style="text-align:center;"|275&thinsp;295&thinsp;799 / 77&thinsp;597&thinsp;520 || ~

|-

| style="text-align:right;"|20 || style="text-align:center;"|55&thinsp;835&thinsp;135 / 15&thinsp;519&thinsp;504 || ~

|-

| style="text-align:right;"|21 || style="text-align:center;"|18&thinsp;858&thinsp;053 / 5&thinsp;173&thinsp;168 || ~

|-

| style="text-align:right;"|22 || style="text-align:center;"|19&thinsp;093&thinsp;197 / 5&thinsp;173&thinsp;168 || ~

|-

| style="text-align:right;"|23 || style="text-align:center;"|444&thinsp;316&thinsp;699 / 118&thinsp;982&thinsp;864 || ~

|-

| style="text-align:right;"|24 || style="text-align:center;"|1&thinsp;347&thinsp;822&thinsp;955 / 356&thinsp;948&thinsp;592 || ~

|-

| style="text-align:right;"|25 || style="text-align:center;"|34&thinsp;052&thinsp;522&thinsp;467 / 8&thinsp;923&thinsp;714&thinsp;800 || ~

|-

| style="text-align:right;"|26 || style="text-align:center;"|34&thinsp;395&thinsp;742&thinsp;267 / 8&thinsp;923&thinsp;714&thinsp;800 || ~

|-

| style="text-align:right;"|27 || style="text-align:center;"|312&thinsp;536&thinsp;252&thinsp;003 / 80&thinsp;313&thinsp;433&thinsp;200 || ~

|-

| style="text-align:right;"|28 || style="text-align:center;"|315&thinsp;404&thinsp;588&thinsp;903 / 80&thinsp;313&thinsp;433&thinsp;200 || ~

|-

| style="text-align:right;"|29 || style="text-align:center;"|9&thinsp;227&thinsp;046&thinsp;511&thinsp;387 / 2&thinsp;329&thinsp;089&thinsp;562&thinsp;800 || ~

|-

| style="text-align:right;"|30 || style="text-align:center;"|9&thinsp;304&thinsp;682&thinsp;830&thinsp;147 / 2&thinsp;329&thinsp;089&thinsp;562&thinsp;800 || ~

|-

| style="text-align:right;"|31 || style="text-align:center;"|290&thinsp;774&thinsp;257&thinsp;297&thinsp;357 / 72&thinsp;201&thinsp;776&thinsp;446&thinsp;800 || ~

|-

| style="text-align:right;"|32 || style="text-align:center;"|586&thinsp;061&thinsp;125&thinsp;622&thinsp;639 / 144&thinsp;403&thinsp;552&thinsp;893&thinsp;600 || ~

|-

| style="text-align:right;"|33 || style="text-align:center;"|53&thinsp;676&thinsp;090&thinsp;078&thinsp;349 / 13&thinsp;127&thinsp;595&thinsp;717&thinsp;600 || ~

|-

| style="text-align:right;"|34 || style="text-align:center;"|54&thinsp;062&thinsp;195&thinsp;834&thinsp;749 / 13&thinsp;127&thinsp;595&thinsp;717&thinsp;600 || ~

|-

| style="text-align:right;"|35 || style="text-align:center;"|54&thinsp;437&thinsp;269&thinsp;998&thinsp;109 / 13&thinsp;127&thinsp;595&thinsp;717&thinsp;600 || ~

|-

| style="text-align:right;"|36 || style="text-align:center;"|54&thinsp;801&thinsp;925&thinsp;434&thinsp;709 / 13&thinsp;127&thinsp;595&thinsp;717&thinsp;600 || ~

|-

| style="text-align:right;"|37 || style="text-align:center;"|2&thinsp;040&thinsp;798&thinsp;836&thinsp;801&thinsp;833 / 485&thinsp;721&thinsp;041&thinsp;551&thinsp;200 || ~

|-

| style="text-align:right;"|38 || style="text-align:center;"|2&thinsp;053&thinsp;580&thinsp;969&thinsp;474&thinsp;233 / 485&thinsp;721&thinsp;041&thinsp;551&thinsp;200 || ~

|-

| style="text-align:right;"|39 || style="text-align:center;"|2&thinsp;066&thinsp;035&thinsp;355&thinsp;155&thinsp;033 / 485&thinsp;721&thinsp;041&thinsp;551&thinsp;200 || ~

|-

| style="text-align:right;"|40 || style="text-align:center;"|2&thinsp;078&thinsp;178&thinsp;381&thinsp;193&thinsp;813 / 485&thinsp;721&thinsp;041&thinsp;551&thinsp;200 || ~

|}

<!-- Python script to generate n from 2 to 40:

import fractions

numerator = 1; denominator = 1

for i in range(2, 40 + 1):

numerator = numerator * i + denominator; denominator *= i; gcd = fractions.gcd(numerator, denominator); numerator /= gcd; denominator /= gcd

decimal = ('{}' if (i < 3 or i == 6) else '{:.5f}').format(float(numerator) / denominator); exact = if (i < 3 or i == 6) else '~'

numerator_length = len(str(numerator));

print('|-\n| style="text-align:right;"|{} || style="text-align:center;{}"|{:,} / {:,} || {}'.

format(i, numerator, denominator, exact, decimal).replace(',', '&thinsp;'))

-->

Identities involving harmonic numbers

By definition, the harmonic numbers satisfy the recurrence relation

<math display="block"> H_{n + 1} = H_{n} + \frac{1}{n + 1}.</math>

The harmonic numbers are connected to the Stirling numbers of the first kind by the relation

<math display="block"> H_n = \frac{1}{n!}\left[{n+1 \atop 2}\right]. </math>

The harmonic numbers satisfy the series identities

<math display="block"> \sum_{k=1}^n H_k = (n+1) H_{n} - n</math>

and

<math display="block">\sum_{k=1}^n H_k^2 = (n+1)H_{n}^2 - (2 n +1) H_n + 2 n.</math>

These two results are closely analogous to the corresponding integral results

<math display="block">\int_0^x \log y \ d y = x \log x - x</math>

and

<math display="block">\int_0^x (\log y)^2\ d y = x (\log x)^2 - 2 x \log x + 2 x.</math>

Identities involving

There are several infinite summations involving harmonic numbers and powers of Pi|:

<math display="block">\begin{align}

\sum_{n=1}^\infty \frac{H_n}{n\cdot 2^n} &= \frac{\pi^2}{12} \\

\sum_{n=1}^\infty \frac{H_n^2}{n^2} &= \frac{17}{360}\pi^4 \\

\sum_{n=1}^\infty \frac{H_n^2}{(n+1)^2} &= \frac{11}{360}\pi^4 \\

\sum_{n=1}^\infty \frac{H_n}{n^3} &= \frac{\pi^4}{72}

\end{align}</math>

Calculation

An integral representation given by Euler is

<math display="block"> H_n = \int_0^1 \frac{1 - x^n}{1 - x}\,dx. </math>

The equality above is straightforward by the simple algebraic identity

<math display="block"> \frac{1-x^n}{1-x}=1+x+\cdots +x^{n-1}.</math>

Using the substitution , another expression for is

<math display="block">\begin{align}

H_n &= \int_0^1 \frac{1 - x^n}{1 - x}\,dx = \int_0^1\frac{1-(1-u)^n}{u}\,du \\[6pt]

&= \int_0^1\left[\sum_{k=1}^n \binom nk (-u)^{k-1}\right]\,du

= \sum_{k=1}^n \binom nk \int_0^1 (-u)^{k-1}\,du \\[6pt]

&= \sum_{k=1}^n \binom nk \frac{(-1)^{k-1{k}.

\end{align}

</math>

thumb|Graph demonstrating a connection between harmonic numbers and the [[natural logarithm. The harmonic number can be interpreted as a Riemann sum of the integral: <math>\int_1^{n+1} \frac{dx}{x} = \ln(n+1).</math>]]

The th harmonic number is about as large as the natural logarithm of . The reason is that the sum is approximated by the integral

<math display="block">\int_1^n \frac{1}{x}\, dx,</math>

whose value is .

The values of the sequence decrease monotonically towards the limit

<math display="block"> \lim_{n \to \infty} \left(H_n - \ln n\right) = \gamma,</math>

where is the Euler–Mascheroni constant. The corresponding asymptotic expansion is

<math display="block">\begin{align}

H_n &\sim \ln{n}+\gamma+\frac{1}{2n}-\sum_{k=1}^\infty \frac{B_{2k{2k n^{2k\\

&=\ln{n}+\gamma+\frac{1}{2n}-\frac{1}{12n^2}+\frac{1}{120n^4}-\cdots,

\end{align}</math>

where are the Bernoulli numbers.

Generating functions

A generating function for the harmonic numbers is

<math display="block">\sum_{n=1}^\infty z^n H_n = \frac {-\ln(1-z)}{1-z},</math>

where ln(z) is the natural logarithm. An exponential generating function is

<math display="block">\sum_{n=1}^\infty \frac {z^n}{n!} H_n = e^z \sum_{k=1}^\infty \frac{(-1)^{k-1{k} \frac {z^k}{k!} = e^z \operatorname{Ein}(z)</math>

where Ein(z) is the entire exponential integral. The exponential integral may also be expressed as

<math display="block">\operatorname{Ein}(z) = \mathrm{E}_1(z) + \gamma + \ln z = \Gamma (0,z) + \gamma + \ln z</math>

where Γ(0, z) is the incomplete gamma function.

Arithmetic properties

The harmonic numbers have several interesting arithmetic properties. It is well-known that <math display="inline">H_n</math> is an integer if and only if <math display="inline">n=1</math>, a result often attributed to Theisinger. Indeed, using 2-adic valuation, it is not difficult to prove that for <math display="inline">n \ge 2</math> the numerator of <math display="inline">H_n</math> is an odd number while the denominator of <math display="inline">H_n</math> is an even number. More precisely,

<math display="block">H_n=\frac{1}{2^{\lfloor\log_2(n)\rfloor\frac{a_n}{b_n}</math>

with some odd integers <math display="inline">a_n</math> and <math display="inline">b_n</math>.

As a consequence of Wolstenholme's theorem, for any prime number <math>p \ge 5</math> the numerator of <math>H_{p-1}</math> is divisible by <math display="inline">p^2</math>. Furthermore, Eisenstein proved that for all odd prime number <math display="inline">p</math> it holds

<math display="block">H_{(p-1)/2} \equiv -2q_p(2) \pmod p</math>

where <math display="inline">q_p(2) = (2^{p-1} -1)/p</math> is a Fermat quotient, with the consequence that <math display="inline">p</math> divides the numerator of <math>H_{(p-1)/2}</math> if and only if <math display="inline">p</math> is a Wieferich prime.

In 1991, Eswarathasan and Levine defined <math>J_p</math> as the set of all positive integers <math>n</math> such that the numerator of <math>H_n</math> is divisible by a prime number <math>p.</math> They proved that

<math display="block">\{p-1,p^2-p,p^2-1\}\subseteq J_p</math>

for all prime numbers <math>p \ge 5,</math> and they defined harmonic primes to be the primes <math display="inline">p</math> such that <math>J_p</math> has exactly 3 elements.

Eswarathasan and Levine also conjectured that <math>J_p</math> is a finite set for all primes <math>p,</math> and that there are infinitely many harmonic primes. Boyd verified that <math>J_p</math> is finite for all prime numbers up to <math>p = 547</math> except 83, 127, and 397; and he gave a heuristic suggesting that the density of the harmonic primes in the set of all primes should be <math>1/e</math>. Sanna showed that <math>J_p</math> has zero asymptotic density, while Bing-Ling Wu and Yong-Gao Chen proved that the number of elements of <math>J_p</math> not exceeding <math>x</math> is at most <math>3x^{\frac{2}{3}+\frac1{25 \log p</math>, for all <math>x \geq 1</math>.

Applications

The harmonic numbers appear in several calculation formulas, such as the digamma function

<math display="block"> \psi(n) = H_{n-1} - \gamma.</math>

This relation is also frequently used to define the extension of the harmonic numbers to non-integer n. The harmonic numbers are also frequently used to define using the limit introduced earlier:

<math display="block"> \gamma = \lim_{n \rightarrow \infty}{\left(H_n - \ln(n)\right)}, </math>

although

<math display="block"> \gamma = \lim_{n \to \infty}{\left(H_n - \ln\left(n+\frac{1}{2}\right)\right)} </math>

converges more quickly.

In 2002, Jeffrey Lagarias proved that the Riemann hypothesis is equivalent to the statement that

<math display="block"> \sigma(n) \le H_n + (\log H_n)e^{H_n},</math>

is true for every integer with strict inequality if ; here denotes the sum of the divisors of .

The eigenvalues of the nonlocal problem on <math> L^2([-1,1])</math>

<math display="block"> \lambda \varphi(x) = \int_{-1}^{1} \frac{\varphi(x)-\varphi(y)}{|x-y|} \, dy </math>

are given by <math>\lambda = 2H_n</math>, where by convention <math>H_0 = 0</math>, and the corresponding eigenfunctions are given by the Legendre polynomials <math>\varphi(x) = P_n(x)</math>.

Generalizations

Generalized harmonic numbers

The nth generalized harmonic number of order m is given by

<math display="block">H_{n,m}=\sum_{k=1}^n \frac{1}{k^m}.</math>

(In some sources, this may also be denoted by <math display="inline">H_n^{(m)}</math> or <math display="inline">H_m(n).</math>)

The special case m = 0 gives <math>H_{n,0}= n.</math> The special case m = 1 reduces to the usual harmonic number:

<math display="block">H_{n, 1} = H_n = \sum_{k=1}^n \frac{1}{k}.</math>

The limit of <math display="inline">H_{n, m}</math> as is finite if , with the generalized harmonic number bounded by and converging to the Riemann zeta function

<math display="block">\lim_{n\rightarrow \infty} H_{n,m} = \zeta(m).</math>

The smallest natural number k such that k<sup>n</sup> does not divide the denominator of generalized harmonic number H(k, n) nor the denominator of alternating generalized harmonic number H′(k, n) is, for n=1, 2, ... :

:77, 20, 94556602, 42, 444, 20, 104, 42, 76, 20, 77, 110, 3504, 20, 903, 42, 1107, 20, 104, 42, 77, 20, 2948, 110, 136, 20, 76, 42, 903, 20, 77, 42, 268, 20, 7004, 110, 1752, 20, 19203, 42, 77, 20, 104, 42, 76, 20, 370, 110, 1107, 20, ...

The related sum <math>\sum_{k=1}^n k^m</math> occurs in the study of Bernoulli numbers; the harmonic numbers also appear in the study of Stirling numbers.

Some integrals of generalized harmonic numbers are

<math display="block">\int_0^a H_{x,2} \, dx = a \frac {\pi^2}{6}-H_{a}</math>

and

<math display="block">\int_0^a H_{x,3} \, dx = a A - \frac {1}{2} H_{a,2},</math> where A is Apéry's constant ζ(3),

and

<math display="block">\sum_{k=1}^n H_{k,m}=(n+1)H_{n,m}- H_{n,m-1} \text{ for } m \geq 0 .</math>

Every generalized harmonic number of order m can be written as a function of harmonic numbers of order <math>m-1</math> using

<math display="block">H_{n,m} = \sum_{k=1}^{n-1} \frac {H_{k,m-1{k(k+1)} + \frac {H_{n,m-1{n} </math> &nbsp; for example: <math>H_{4,3} = \frac {H_{1,2{1 \cdot 2} + \frac {H_{2,2{2 \cdot 3} + \frac {H_{3,2{3 \cdot 4} + \frac {H_{4,2{4} </math>

A generating function for the generalized harmonic numbers is

<math display="block">\sum_{n=1}^\infty z^n H_{n,m} = \frac {\operatorname{Li}_m(z)}{1-z},</math>

where <math>\operatorname{Li}_m(z)</math> is the polylogarithm, and . The generating function given above for is a special case of this formula.

A fractional argument for generalized harmonic numbers can be introduced as follows:

For every <math>p,q>0</math> integer, and <math>m>1</math> integer or not, we have from polygamma functions:

<math display="block">H_{q/p,m}=\zeta(m)-p^m\sum_{k=1}^\infty \frac{1}{(q+pk)^m}</math>

where <math>\zeta(m)</math> is the Riemann zeta function. The relevant recurrence relation is

<math display="block">H_{a,m}=H_{a-1,m}+\frac{1}{a^m}.</math>

Some special values are<math display="block">\begin{align}

H_{\frac{1}{4},2} &= 16-\tfrac{5}{6}\pi^2 -8G\\

H_{\frac{1}{2},2} &= 4-\frac{\pi^2}{3} \\

H_{\frac{3}{4},2} &= \frac{16}{9}-\frac{5}{6}\pi^2 + 8G \\

H_{\frac{1}{4},3} &= 64-\pi^3-27\zeta(3) \\

H_{\frac{1}{2},3} & =8-6\zeta(3) \\

H_{\frac{3}{4},3} &= \left(\frac{4}{3}\right)^3+\pi^3 -27\zeta(3)

\end{align}</math>where G is Catalan's constant. In the special case that <math>p = 1</math>, we get

<math display="block">H_{n,m}=\zeta(m, 1) - \zeta(m, n+1),</math>

where <math>\zeta(m, n)</math> is the Hurwitz zeta function. This relationship is used to calculate harmonic numbers numerically.

Multiplication formulas

The multiplication theorem applies to harmonic numbers. Using polygamma functions, we obtain

<math display="block">\begin{align}

H_{2x} & =\frac{1}{2}\left(H_x+H_{x-\frac{1}{2\right)+\ln 2 \\

H_{3x} &= \frac{1}{3}\left(H_x+H_{x-\frac{1}{3+H_{x-\frac{2}{3\right)+\ln 3,

\end{align}</math>

or, more generally,

<math display="block">H_{nx}=\frac{1}{n}\left(H_x+H_{x-\frac{1}{n+H_{x-\frac{2}{n+\cdots +H_{x-\frac{n-1}{n \right) + \ln n.</math>

For generalized harmonic numbers, we have

<math display="block">\begin{align}

H_{2x,2} &= \frac{1}{2}\left(\zeta(2)+\frac{1}{2}\left(H_{x,2}+H_{x-\frac{1}{2},2}\right)\right) \\

H_{3x,2} &= \frac{1}{9}\left(6\zeta(2)+H_{x,2}+H_{x-\frac{1}{3},2}+H_{x-\frac{2}{3},2}\right),

\end{align}</math>

where <math>\zeta(n)</math> is the Riemann zeta function.

Hyperharmonic numbers

The next generalization was discussed by J. H. Conway and R. K. Guy in their 1995 book The Book of Numbers. named after Steven Roman, were introduced by Daniel Loeb and Gian-Carlo Rota in the context of a generalization of umbral calculus with logarithms. There are many possible definitions, but one of them, for <math>n,k \geq 0</math>, is<math display="block"> c_n^{(0)} = 1, </math>and<math display="block"> c_n^{(k+1)} = \sum_{i=1}^n\frac{c_i^{(k){i}. </math>Of course,<math display="block"> c_n^{(1)} = H_n. </math>

If <math>n \neq 0</math>, they satisfy<math display="block"> c_n^{(k+1)} - \frac{c_n^{(k){n} = c_{n-1}^{(k+1)}. </math>Closed form formulas are<math display="block"> c_n^{(k)} = n! (-1)^k s(-n,k), </math>where <math>s(-n,k)</math> is Stirling numbers of the first kind generalized to negative first argument, and<math display="block"> c_n^{(k)} = \sum_{j=1}^n \binom{n}{j} \frac{(-1)^{j-1{j^k}, </math>which was found by Donald Knuth.

In fact, these numbers were defined in a more general manner using Roman numbers and Roman factorials, that include negative values for <math>n</math>. This generalization was useful in their study to define Harmonic logarithms.

Harmonic numbers for real and complex values

The formulae given above,

<math display="block"> H_x = \int_0^1 \frac{1-t^x}{1-t} \, dt= \sum_{k=1}^\infty {x \choose k} \frac{(-1)^{k-1{k}</math>

are an integral and a series representation for a function that interpolates the harmonic numbers and, via analytic continuation, extends the definition to the complex plane other than the negative integers x. The interpolating function is in fact closely related to the digamma function

<math display="block">H_x = \psi(x+1)+\gamma,</math>

where is the digamma function, and is the Euler–Mascheroni constant. The integration process may be repeated to obtain

<math display="block">H_{x,2}= \sum_{k=1}^\infty \frac {(-1)^{k-1{k} {x \choose k} H_k.</math>

The Taylor series for the harmonic numbers is

<math display="block">H_x=\sum_{k=2}^\infty (-1)^{k}\zeta (k)\;x^{k-1}\quad\text{ for } |x| < 1</math>

which comes from the Taylor series for the digamma function (<math>\zeta </math> is the Riemann zeta function).

Alternative, asymptotic formulation

There is an asymptotic formulation that gives the same result as the analytic continuation of the integral just described. When seeking to approximate&nbsp; for a complex number&nbsp;, it is effective to first compute&nbsp; for some large integer&nbsp;. Use that as an approximation for the value of&nbsp;. Then use the recursion relation backwards&nbsp; times, to unwind it to an approximation for&nbsp;. Furthermore, this approximation is exact in the limit as&nbsp; goes to infinity.

Specifically, for a fixed integer&nbsp;, it is the case that

<math display="block">\lim_{m \rightarrow \infty} \left[H_{m+n} - H_m\right] = 0.</math>

If&nbsp; is not an integer then it is not possible to say whether this equation is true because we have not yet (in this section) defined harmonic numbers for non-integers. However, we do get a unique extension of the harmonic numbers to the non-integers by insisting that this equation continue to hold when the arbitrary integer&nbsp; is replaced by an arbitrary complex number&nbsp;,

<math display="block">\lim_{m \rightarrow \infty} \left[H_{m+x} - H_m\right] = 0\,.</math>

Swapping the order of the two sides of this equation and then subtracting them from&nbsp; gives

<math display="block">

\begin{align}H_x &= \lim_{m \rightarrow \infty} \left[H_m - (H_{m+x}-H_x)\right] \\[6pt]

&= \lim_{m \rightarrow \infty} \left[\left(\sum_{k=1}^m \frac{1}{k}\right) - \left(\sum_{k=1}^m \frac{1}{x+k}\right) \right] \\[6pt]

&= \lim_{m \rightarrow \infty} \sum_{k=1}^m \left(\frac{1}{k} - \frac{1}{x+k}\right) = x \sum_{k=1}^{\infty} \frac{1}{k(x+k)}\, .

\end{align}

</math>

This infinite series converges for all complex numbers&nbsp; except the negative integers, which fail because trying to use the recursion relation backwards through the value&nbsp; involves a division by zero. By this construction, the function that defines the harmonic number for complex values is the unique function that simultaneously satisfies (1) , (2) for all complex numbers&nbsp; except the non-positive integers, and (3) for all complex values&nbsp;.

This last formula can be used to show that

<math display="block"> \int_0^1 H_x \, dx = \gamma, </math>

where&nbsp; is the Euler–Mascheroni constant or, more generally, for every&nbsp; we have:

<math display="block"> \int_0^nH_{x}\,dx = n\gamma + \ln(n!) .</math>

Special values for fractional arguments

There are the following special analytic values for fractional arguments between 0 and 1, given by the integral

<math display="block">H_\alpha = \int_0^1\frac{1-x^\alpha}{1-x}\,dx\, .</math>

More values may be generated from the recurrence relation

<math display="block"> H_\alpha = H_{\alpha-1}+\frac{1}{\alpha}\,,</math>

or from the reflection relation

<math display="block"> H_{-\alpha}-H_{\alpha-1} = \pi\cot{(\pi\alpha)}.</math>

For example:

<math display="block"> \begin{align}

H_{\frac{1}{2 &= 2 - 2\ln 2 \\

H_{\frac{1}{3 &= 3 - \frac{\pi}{2\sqrt{3 - \frac{3}{2}\ln 3 \\

H_{\frac{2}{3 &= \frac{3}{2}+\frac{\pi}{2\sqrt{3 - \frac{3}{2}\ln 3 \\

H_{\frac{1}{4 &= 4 - \frac{\pi}{2} - 3\ln 2 \\

H_{\frac{1}{5 &= 5 - \frac{\pi}{2} \sqrt{1+\frac{2}{\sqrt{5} - \frac{5}{4} \ln 5 - \frac{\sqrt{5{2} \ln\left(\frac{1+\sqrt{5{2}\right) \\

H_{\frac{3}{4 &= \frac{4}{3} + \frac{\pi}{2} - 3\ln 2 \\

H_{\frac{1}{6 &= 6 - \frac{\sqrt{3{2} \pi - 2\ln 2 - \frac{3}{2} \ln 3 \\

H_{\frac{1}{8 &= 8 - \frac{1+\sqrt{2{2} \pi - 4\ln{2} - \frac{1}{\sqrt{2 \left(\ln\left(2 + \sqrt{2}\right) - \ln\left(2 - \sqrt{2}\right)\right) \\

H_{\frac{1}{12 &= 12 - \left(1+\frac{\sqrt{3{2}\right)\pi - 3\ln{2} - \frac{3}{2} \ln{3} + \sqrt{3} \ln\left(2-\sqrt{3}\right)

\end{align}</math>

Which are computed via Gauss's digamma theorem, which essentially states that for positive integers p and q with p < q

<math display="block"> H_{\frac{p}{q = \frac{q}{p} +2\sum_{k=1}^{\lfloor\frac{q-1}{2}\rfloor} \cos\left(\frac{2 \pi pk}{q}\right)\ln\left({\sin \left(\frac{\pi k}{q}\right)}\right)-\frac{\pi}{2}\cot\left(\frac{\pi p}{q}\right)-\ln\left(2q\right)</math>

Relation to the Riemann zeta function

Some derivatives of fractional harmonic numbers are given by

<math display="block">

\begin{align}

\frac{d^n H_x}{dx^n} & = (-1)^{n+1}n!\left[\zeta(n+1)-H_{x,n+1}\right] \\[6pt]

\frac{d^n H_{x,2{dx^n} & = (-1)^{n+1}(n+1)!\left[\zeta(n+2)-H_{x,n+2}\right] \\[6pt]

\frac{d^n H_{x,3{dx^n} & = (-1)^{n+1}\frac{1}{2}(n+2)!\left[\zeta(n+3)-H_{x,n+3}\right].

\end{align}

</math>

And using Maclaurin series, we have for x < 1 that

<math display="block">

\begin{align}

H_x & = \sum_{n=1}^\infty (-1)^{n+1}x^n\zeta(n+1) \\[5pt]

H_{x,2} & = \sum_{n=1}^\infty (-1)^{n+1}(n+1)x^n\zeta(n+2) \\[5pt]

H_{x,3} & = \frac{1}{2}\sum_{n=1}^\infty (-1)^{n+1}(n+1)(n+2)x^n\zeta(n+3).

\end{align}

</math>

For fractional arguments between 0 and 1 and for a > 1,

<math display="block">

\begin{align}

H_{1/a} & = \frac{1}{a}\left(\zeta(2)-\frac{1}{a}\zeta(3)+\frac{1}{a^2}\zeta(4)-\frac{1}{a^3} \zeta(5) + \cdots\right) \\[6pt]

H_{1/a, \, 2} & = \frac{1}{a}\left(2\zeta(3)-\frac{3}{a}\zeta(4)+\frac{4}{a^2}\zeta(5)-\frac{5}{a^3} \zeta(6) + \cdots\right) \\[6pt]

H_{1/a, \, 3} & = \frac{1}{2a}\left(2\cdot3\zeta(4)-\frac{3\cdot4}{a}\zeta(5)+\frac{4\cdot5}{a^2}\zeta(6)-\frac{5\cdot6}{a^3}\zeta(7)+\cdots\right).

\end{align}

</math>

See also

  • Watterson estimator
  • Tajima's D
  • Coupon collector's problem
  • Jeep problem
  • 100 prisoners problem
  • Riemann zeta function
  • List of sums of reciprocals
  • False discovery rate#Benjamini–Yekutieli procedure
  • Block-stacking problem

Notes

References

  • Ed Sandifer, How Euler Did It — Estimating the Basel problem (2003)