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

Exercise 1.2.7-18

stated in Lean solution written

RatingM33
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

Find the highest power of 22 that divides the numerator of 1+13+⋯+12n−11 + \frac13 + \cdots + \frac{1}{2n-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

Let 2e2^e be the highest power of 22 that divides nn. Treat e=0e = 0 separately. For e≥1e \ge 1 pair the odd numbers jj and 2n−j2n - j.

Hint 2

After the pairing, expand 1j(2n−j)\frac{1}{j(2n-j)} as a series in 2nj\frac{2n}{j}. Only the first term matters modulo a high power of 22.

Hint 3

To finish, sum 1j2\frac{1}{j^2} over the odd j<nj < n modulo 2e2^e by sorting the jj by their residue modulo 2e2^e.

Solution

Show the solution

Answer: 22e2^{2e}, where 2e2^e is the highest power of 22 dividing nn. Plan: find the 2-adic valuation v2v_2 of On=∑k=1n12k−1O_n = \sum_{k=1}^{n}\frac{1}{2k-1} in the ring of fractions with odd denominators. A fraction in lowest terms has the same v2v_2 as its numerator when the denominator is odd, and the denominator of OnO_n is odd.

Case e=0e = 0. Put the nn terms over the common odd denominator D=∏(2k−1)D = \prod(2k-1). The numerator is ∑D/(2k−1)\sum D/(2k-1), a sum of nn odd numbers, which is odd because nn is odd. So v2(On)=0=2ev_2(O_n) = 0 = 2e.

Case e≥1e \ge 1. Then nn is even. The odd numbers j<2nj < 2n are the odd j<nj < n and the numbers 2n−j2n - j with jj odd and j<nj < n. So

On=∑j oddj<n(1j+12n−j)=2n T,T=∑j oddj<n1j(2n−j).O_n = \sum_{\substack{j\ \text{odd}\\ j < n}}\left(\frac1j + \frac{1}{2n-j}\right) = 2n\,T, \qquad T = \sum_{\substack{j\ \text{odd}\\ j < n}}\frac{1}{j(2n-j)}.

Step 1: TT modulo 2e+12^{e+1}. For odd jj, 1j(2n−j)=−1j2⋅11−2n/j=−1j2−2nj3−(2n)2j4−⋯\frac{1}{j(2n-j)} = -\frac{1}{j^2}\cdot\frac{1}{1 - 2n/j} = -\frac{1}{j^2} - \frac{2n}{j^3} - \frac{(2n)^2}{j^4} - \cdots in the 2-adic integers. Every term after the first is divisible by 2n2n, and v2(2n)=e+1v_2(2n) = e + 1. So T≡−S(mod2e+1)T \equiv -S \pmod{2^{e+1}}, where S=∑j odd, j<nj−2S = \sum_{j\ \text{odd},\,j<n}j^{-2}.

Step 2: v2(S)=e−1v_2(S) = e - 1. Write n=2emn = 2^em with mm odd. The odd j<nj < n are j=r+2etj = r + 2^et with rr odd, 1≤r<2e1 \le r < 2^e, and 0≤t<m0 \le t < m. Since j≡r(mod2e)j \equiv r \pmod{2^e}, j−2≡r−2(mod2e)j^{-2} \equiv r^{-2} \pmod{2^e}, and

S≡m∑r oddr<2er−2(mod2e).S \equiv m\sum_{\substack{r\ \text{odd}\\ r < 2^e}}r^{-2} \pmod{2^e}.

The map r↦r−1r \mapsto r^{-1} permutes the odd residues modulo 2e2^e. So ∑r−2≡∑r2(mod2e)\sum r^{-2} \equiv \sum r^2 \pmod{2^e}. With K=2e−1K = 2^{e-1} the sum of the first KK odd squares is ∑r2=K(2K−1)(2K+1)3=2e−1⋅4e−13\sum r^2 = \frac{K(2K-1)(2K+1)}{3} = 2^{e-1}\cdot\frac{4^e - 1}{3}, and 4e−13\frac{4^e - 1}{3} is an odd integer. So S≡m⋅2e−1⋅(odd)≡2e−1(mod2e)S \equiv m \cdot 2^{e-1}\cdot(\text{odd}) \equiv 2^{e-1} \pmod{2^e}, because mm is odd. Thus v2(S)=e−1v_2(S) = e - 1.

Step 3. Since e−1<e+1e - 1 < e + 1, Step 1 gives v2(T)=e−1v_2(T) = e - 1. Therefore v2(On)=(e+1)+(e−1)=2ev_2(O_n) = (e + 1) + (e - 1) = 2e.

In both cases the highest power of 22 that divides the numerator of OnO_n is 22e2^{2e}.

Check

The values OnO_n for n=1,2,3,4,6,8n = 1, 2, 3, 4, 6, 8 are 11, 43\frac43, 2315\frac{23}{15}, 176105\frac{176}{105}, 65083465\frac{6508}{3465}, 9107245045\frac{91072}{45045}. Their numerators have 22-adic valuations 0,2,0,4,2,60, 2, 0, 4, 2, 6, as 22e2^{2e} predicts: 4=224 = 2^2, 176=16⋅11176 = 16 \cdot 11, 6508=4⋅16276508 = 4 \cdot 1627, 91072=64⋅142391072 = 64 \cdot 1423. Python checks all n<300n < 300, and it checks that v2(S)=e−1v_2(S) = e - 1 for n=2,4,6,8,12,16,24,32,48,64n = 2, 4, 6, 8, 12, 16, 24, 32, 48, 64.

Remarks

The result says that On=22e m1/m2O_n = 2^{2e}\,m_1/m_2 with m1m_1 and m2m_2 odd. Exercise 1.2.7-17 asks a divisibility question of the same kind for an odd prime pp and the numerator of Hp−1H_{p-1}.

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.