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

Exercise 1.2.7-22

stated in Lean solution written

RatingM28
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=0nHkHn−k\sum_{k=0}^{n}H_kH_{n-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

Use generating functions. The series ∑nHnzn\sum_nH_nz^n is −ln⁡(1−z)1−z\frac{-\ln(1-z)}{1-z}. Square it.

Hint 2

The square is ln⁡2(1−z)(1−z)2\frac{\ln^2(1-z)}{(1-z)^2}. Find a power of (1−z)(1-z) with a parameter aa whose derivatives in aa produce ln⁡2(1−z)\ln^2(1-z).

Hint 3

Differentiate the coefficient (n+a−1n)\binom{n+a-1}{n} twice in aa and set a=2a = 2.

Solution

Show the solution

Generating function. Since 11−z=∑zk\frac{1}{1-z} = \sum z^k and −ln⁡(1−z)=∑j≥1zj/j-\ln(1-z) = \sum_{j \ge 1}z^j/j, the product is ∑nzn∑j≤n1j=∑nHnzn\sum_n z^n\sum_{j \le n}\frac1j = \sum_nH_nz^n. So

∑n(∑k=0nHkHn−k)zn=ln⁡2(1−z)(1−z)2.\sum_{n}\left(\sum_{k=0}^{n}H_kH_{n-k}\right)z^n = \frac{\ln^2(1-z)}{(1-z)^2}.

Parameter. As formal power series, (1−z)−a=e−aln⁡(1−z)=∑n(n+a−1n)zn(1-z)^{-a} = e^{-a\ln(1-z)} = \sum_n\binom{n+a-1}{n}z^n, where (n+a−1n)=a(a+1)⋯(a+n−1)n!\binom{n+a-1}{n} = \frac{a(a+1)\cdots(a+n-1)}{n!} is a polynomial Pn(a)P_n(a) in aa. Since ln⁡(1−z)\ln(1-z) has no constant term, each coefficient of znz^n in e−aln⁡(1−z)e^{-a\ln(1-z)} is a polynomial in aa, and differentiation in aa commutes with taking the coefficient. Differentiating twice in aa gives ln⁡2(1−z) (1−z)−a\ln^2(1-z)\,(1-z)^{-a}. So the wanted sum is Pn′′(2)P_n''(2).

Derivatives. ln⁡Pn(a)=∑i=0n−1ln⁡(a+i)−ln⁡n!\ln P_n(a) = \sum_{i=0}^{n-1}\ln(a+i) - \ln n!. So Pn′Pn=∑i=0n−11a+i\frac{P_n'}{P_n} = \sum_{i=0}^{n-1}\frac{1}{a+i} and (Pn′Pn)′=−∑i=0n−11(a+i)2\left(\frac{P_n'}{P_n}\right)' = -\sum_{i=0}^{n-1}\frac{1}{(a+i)^2}. Since P′′=P((P′P)2+(P′P)′)P'' = P\left(\left(\frac{P'}{P}\right)^2 + \left(\frac{P'}{P}\right)'\right),

Pn′′(a)=Pn(a)[(∑i=0n−11a+i)2−∑i=0n−11(a+i)2].P_n''(a) = P_n(a)\left[\left(\sum_{i=0}^{n-1}\frac{1}{a+i}\right)^2 - \sum_{i=0}^{n-1}\frac{1}{(a+i)^2}\right].

At a=2a = 2: Pn(2)=(n+1)!n!=n+1P_n(2) = \frac{(n+1)!}{n!} = n + 1, ∑i=0n−112+i=Hn+1−1\sum_{i=0}^{n-1}\frac{1}{2+i} = H_{n+1} - 1, and ∑i=0n−11(2+i)2=Hn+1(2)−1\sum_{i=0}^{n-1}\frac{1}{(2+i)^2} = H_{n+1}^{(2)} - 1. So the sum is (n+1)[(Hn+1−1)2−Hn+1(2)+1](n+1)\left[(H_{n+1} - 1)^2 - H_{n+1}^{(2)} + 1\right].

Conversion to HnH_n. Put Hn+1−1=Hn−nn+1H_{n+1} - 1 = H_n - \frac{n}{n+1} and Hn+1(2)−1=Hn(2)+1(n+1)2−1H_{n+1}^{(2)} - 1 = H_n^{(2)} + \frac{1}{(n+1)^2} - 1. Then

(Hn+1−1)2−(Hn+1(2)−1)=Hn2−Hn(2)−2nn+1Hn+n2−1(n+1)2+1=Hn2−Hn(2)−2nn+1Hn+2nn+1.(H_{n+1}-1)^2 - \left(H_{n+1}^{(2)} - 1\right) = H_n^2 - H_n^{(2)} - \frac{2n}{n+1}H_n + \frac{n^2 - 1}{(n+1)^2} + 1 = H_n^2 - H_n^{(2)} - \frac{2n}{n+1}H_n + \frac{2n}{n+1}.

Multiply by n+1n + 1:

∑k=0nHkHn−k=(n+1)(Hn2−Hn(2))−2n(Hn−1).\sum_{k=0}^{n}H_kH_{n-k} = (n+1)\left(H_n^2 - H_n^{(2)}\right) - 2n\left(H_n - 1\right).

Check

For n=2n = 2 the sum is H0H2+H1H1+H2H0=1H_0H_2 + H_1H_1 + H_2H_0 = 1. The formula gives 3(94−54)−4(32−1)=3−2=13\left(\frac94 - \frac54\right) - 4\left(\frac32 - 1\right) = 3 - 2 = 1. For n=4n = 4 the sum is 2H1H3+H22=113+94=71122H_1H_3 + H_2^2 = \frac{11}{3} + \frac94 = \frac{71}{12}, and the formula gives the same. Python checks n=0,…,29n = 0, \ldots, 29 with exact fractions.

Remarks

The third derivative in aa gives the sum of HjHkHlH_jH_kH_l over j+k+l=nj + k + l = n in the same way. Exercise 1.2.7-21 is a related convolution.

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.