taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.7-21

Exercise 1.2.7-21

stated in Lean solution written

RatingM24
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.7 of Volume 1. Companion chapter: Harmonic numbers

The task

Evaluate ∑k=1nHkn+1−k\sum_{k=1}^{n}\frac{H_k}{n+1-k}.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Write HkH_k as a sum over j≤kj \le k and put l=n+1−kl = n + 1 - k. The sum becomes a sum of 1jl\frac{1}{jl} over pairs of positive integers with a bound on j+lj + l.

Hint 2

Use 1jl=1j+l(1j+1l)\frac{1}{jl} = \frac{1}{j+l}\left(\frac1j + \frac1l\right) and sum over the pairs with the same value of j+lj + l. Then use exercise 14.

Solution

Show the solution

Write Hk=∑j=1k1jH_k = \sum_{j=1}^{k}\frac1j and l=n+1−kl = n + 1 - k. As kk runs from 11 to nn and jj from 11 to kk, the pair (j,l)(j, l) runs over all pairs of positive integers with j+l≤n+1j + l \le n + 1. So

∑k=1nHkn+1−k=∑j,l≥1j+l≤n+11jl.\sum_{k=1}^{n}\frac{H_k}{n+1-k} = \sum_{\substack{j, l \ge 1\\ j + l \le n+1}}\frac{1}{jl}.

Use 1jl=1j+l(1j+1l)\frac{1}{jl} = \frac{1}{j+l}\left(\frac1j + \frac1l\right) and let s=j+ls = j + l with 2≤s≤n+12 \le s \le n + 1. For a fixed ss the pairs are (j,s−j)(j, s-j) with 1≤j≤s−11 \le j \le s - 1, and ∑j=1s−1(1j+1s−j)=2Hs−1\sum_{j=1}^{s-1}\left(\frac1j + \frac{1}{s-j}\right) = 2H_{s-1}. Therefore

∑k=1nHkn+1−k=∑s=2n+12Hs−1s=2∑s=1n+1Hs−1/ss=2∑s=1n+1Hss−2Hn+1(2).\sum_{k=1}^{n}\frac{H_k}{n+1-k} = \sum_{s=2}^{n+1}\frac{2H_{s-1}}{s} = 2\sum_{s=1}^{n+1}\frac{H_s - 1/s}{s} = 2\sum_{s=1}^{n+1}\frac{H_s}{s} - 2H_{n+1}^{(2)}.

The term s=1s = 1 gives H0/1=0H_0/1 = 0, so including it changes nothing. By exercise 14, 2∑s≤n+1Hss=Hn+12+Hn+1(2)2\sum_{s \le n+1}\frac{H_s}{s} = H_{n+1}^2 + H_{n+1}^{(2)}. Hence

∑k=1nHkn+1−k=Hn+12−Hn+1(2).\sum_{k=1}^{n}\frac{H_k}{n+1-k} = H_{n+1}^2 - H_{n+1}^{(2)}.

Check

For n=3n = 3: H13+H22+H31=13+34+116=3512\frac{H_1}{3} + \frac{H_2}{2} + \frac{H_3}{1} = \frac13 + \frac34 + \frac{11}{6} = \frac{35}{12}. The formula gives H42−H4(2)=625144−205144=3512H_4^2 - H_4^{(2)} = \frac{625}{144} - \frac{205}{144} = \frac{35}{12}. Python checks n=1,…,29n = 1, \ldots, 29 with exact fractions.

Remarks

The sum is a convolution of HkH_k with 1m\frac1m, so it is the coefficient of zn+1z^{n+1} in −ln⁡(1−z)1−z⋅(−ln⁡(1−z))=ln⁡2(1−z)1−z\frac{-\ln(1-z)}{1-z}\cdot(-\ln(1-z)) = \frac{\ln^2(1-z)}{1-z}. The method of exercise 1.2.7-22 with the exponent a=1a = 1 gives the same result.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

stated The statement is in Lean and it builds. The proof is not in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.