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

Exercise 1.2.7-19

proved in Lean solution written

RatingM30
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

List all nonnegative integers nn for which HnH_n is an integer.

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

Look at the highest power of 22 that divides one denominator k≤nk \le n. How many terms have that power?

Solution

Show the solution

Answer: n=0n = 0 and n=1n = 1.

H0=0H_0 = 0 and H1=1H_1 = 1 are integers. Let n≥2n \ge 2 and let aa be the integer with 2a≤n<2a+12^a \le n < 2^{a+1}, so a≥1a \ge 1. Use the 2-adic valuation v2v_2. For 1≤k≤n1 \le k \le n, the number kk has v2(k)≤av_2(k) \le a, with equality only for the multiples of 2a2^a. The multiples of 2a2^a up to nn are only 2a2^a, since 2⋅2a>n2 \cdot 2^a > n. So the term 12a\frac{1}{2^a} has v2=−av_2 = -a, and all other terms have v2≥−(a−1)v_2 \ge -(a-1).

Then v2(Hn)=−av_2(H_n) = -a, because one term has the smallest valuation, and the sum of that term and terms of larger valuation keeps the smallest valuation. Since a≥1a \ge 1, v2(Hn)<0v_2(H_n) < 0 and HnH_n is not an integer.

Check

Python tests all n≤420n \le 420 and finds only 00 and 11. For n=6n = 6: H6=4920H_6 = \frac{49}{20} has v2=−2=−av_2 = -2 = -a with a=2a = 2 since 4≤6<84 \le 6 < 8. For n=3n = 3: H3=116H_3 = \frac{11}{6} and a=1a = 1.

Remarks

The same argument shows that the denominator of HnH_n is divisible by 2a2^a for n≥2n \ge 2. So the denominator of HnH_n is even for every n≥2n \ge 2.

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.

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

Something is wrong? Report it.