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-14

Exercise 1.2.7-14

proved in Lean solution written

RatingM22
MarkersM (mathematical)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.7 of Volume 1. Companion chapter: Harmonic numbers

The task

Prove that ∑k=1nHkk=12(Hn2+Hn(2))\sum_{k=1}^{n}\frac{H_k}{k} = \frac12(H_n^2 + H_n^{(2)}), and evaluate ∑k=1nHkk+1\sum_{k=1}^{n}\frac{H_k}{k+1}.

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

For the first sum, compare the identity for nn and for n−1n - 1. The difference of the two right sides is easy.

Hint 2

For the second sum, write Hkk+1\frac{H_k}{k+1} with the index j=k+1j = k + 1 and Hk=Hj−1jH_k = H_j - \frac1j, then use the first result.

Solution

Show the solution

First identity. Let Rn=12(Hn2+Hn(2))R_n = \frac12(H_n^2 + H_n^{(2)}). Then R0=0R_0 = 0. For n≥1n \ge 1 use Hn−1=Hn−1nH_{n-1} = H_n - \frac1n and Hn−1(2)=Hn(2)−1n2H_{n-1}^{(2)} = H_n^{(2)} - \frac{1}{n^2}:

Rn−Rn−1=12(Hn2−Hn−12)+12n2=12⋅1n(2Hn−1n)+12n2=Hnn.R_n - R_{n-1} = \frac12\left(H_n^2 - H_{n-1}^2\right) + \frac{1}{2n^2} = \frac12\cdot\frac1n\left(2H_n - \frac1n\right) + \frac{1}{2n^2} = \frac{H_n}{n}.

So Rn=∑k=1nHkkR_n = \sum_{k=1}^{n}\frac{H_k}{k} by induction.

Second sum. Let j=k+1j = k + 1 and Hk=Hj−1jH_k = H_j - \frac1j. Then

∑k=1nHkk+1=∑j=2n+1Hjj−∑j=2n+11j2.\sum_{k=1}^{n}\frac{H_k}{k+1} = \sum_{j=2}^{n+1}\frac{H_j}{j} - \sum_{j=2}^{n+1}\frac{1}{j^2}.

Add and subtract the terms with j=1j = 1, both equal to 11: the first sum is ∑j=1n+1Hjj−1=12(Hn+12+Hn+1(2))−1\sum_{j=1}^{n+1}\frac{H_j}{j} - 1 = \frac12\left(H_{n+1}^2 + H_{n+1}^{(2)}\right) - 1, and the second is Hn+1(2)−1H_{n+1}^{(2)} - 1. So the difference is

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

Check

For n=3n = 3: ∑k≤3Hkk=1+34+1118=8536\sum_{k \le 3}\frac{H_k}{k} = 1 + \frac34 + \frac{11}{18} = \frac{85}{36}, and 12(H32+H3(2))=12(12136+4936)=8536\frac12(H_3^2 + H_3^{(2)}) = \frac12\left(\frac{121}{36} + \frac{49}{36}\right) = \frac{85}{36}. For the second sum, ∑k≤3Hkk+1=12+12+1124=3524\sum_{k \le 3}\frac{H_k}{k+1} = \frac12 + \frac12 + \frac{11}{24} = \frac{35}{24}, and 12(H42−H4(2))=3524\frac12(H_4^2 - H_4^{(2)}) = \frac{35}{24}. Python checks n=4n = 4 and n=7n = 7.

Remarks

Exercise 1.2.7-25 with u=v=1u = v = 1 is the first identity: it says that 2∑kHk/k=Hn2+Hn(2)2\sum_{k}H_k/k = H_n^2 + H_n^{(2)}. Exercise 1.2.7-21 builds on part (a) and on this part.

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

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only. Lean states the parts one by one.

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

Something is wrong? Report it.