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.9-6

Exercise 1.2.9-6

proved in Lean solution written

RatingHM15
MarkersHM (needs higher mathematics)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.9 of Volume 1. Companion chapter: Generating functions

The task

Find the generating function of ∑0<k<n1k(n−k)\sum_{0<k<n}\frac1{k(n-k)}, then write the coefficients with harmonic numbers.

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

The sequence is a convolution of ⟨1/k⟩\langle1/k\rangle with itself, with the term k=0k=0 left out.

Hint 2

Differentiate the square of the logarithm series, or split 1k(n−k)\frac1{k(n-k)} into partial fractions.

Solution

Show the solution

Let L(z)=ln⁡11−z=∑k≥1zk/kL(z)=\ln\frac1{1-z}=\sum_{k\ge1}z^k/k. The coefficient of znz^n in L(z)2L(z)^2 is ∑k+j=n, k,j≥11kj=∑0<k<n1k(n−k)\sum_{k+j=n,\ k,j\ge1}\frac1{kj}=\sum_{0<k<n}\frac1{k(n-k)}. So the generating function is L(z)2=(ln⁡11−z)2L(z)^2=\bigl(\ln\frac1{1-z}\bigr)^2.

Differentiate: ddzL2=2L⋅11−z=2∑n≥0Hnzn\frac d{dz}L^2=2L\cdot\frac1{1-z}=2\sum_{n\ge0}H_nz^n, because L/(1−z)L/(1-z) is the series (18). The coefficient of zn−1z^{n-1} in the derivative is nn times the coefficient of znz^n in L2L^2. So

∑0<k<n1k(n−k)=2Hn−1n.\sum_{0<k<n}\frac1{k(n-k)}=\frac{2H_{n-1}}n.

The same result follows from 1k(n−k)=1n(1k+1n−k)\frac1{k(n-k)}=\frac1n\bigl(\frac1k+\frac1{n-k}\bigr), which gives 1n⋅2Hn−1\frac1n\cdot2H_{n-1}.

Check

For n=4n=4: 11⋅3+12⋅2+13⋅1=23+14=1112\frac1{1\cdot3}+\frac1{2\cdot2}+\frac1{3\cdot1}=\frac23+\frac14=\frac{11}{12}, and 2H3/4=12⋅116=11122H_3/4=\frac12\cdot\frac{11}6=\frac{11}{12}. For n=1n=1 the sum is empty and H0=0H_0=0.

Remarks

The square is the case m=2m=2 of (ln⁡11−z)m=m!∑k[km]zk/k!\bigl(\ln\frac1{1-z}\bigr)^m=m!\sum_k\left[{k\atop m}\right]z^k/k! in Eq. (26). It shows [n2]=(n−1)!Hn−1\left[{n\atop2}\right]=(n-1)!H_{n-1}.

This solution is drafted, 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.

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

Something is wrong? Report it.