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.1-8

Exercise 1.2.1-8

proved in Lean solution written

Rating25
Markersrecommended
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.1 of Volume 1. Companion chapter: Mathematical induction

The task

(a) Show by induction that the cube n3n^3 is the sum of the nn consecutive odd numbers that start at n2−n+1n^2 - n + 1. (b) Use this to show that 13+23+⋯+n3=(1+2+⋯+n)21^3 + 2^3 + \cdots + n^3 = (1 + 2 + \cdots + n)^2.

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 (a), write the row for nn as n2−n+1+2jn^2 - n + 1 + 2j with 0≤j<n0 \le j < n. Compare row n+1n+1 with row nn term by term.

Hint 2

For (b), look at where row nn ends and row n+1n+1 begins. Put all rows in a line.

Hint 3

The sum of the first TT odd numbers is T2T^2 (eq. (2) of the text), and the rows 1,…,n1, \ldots, n have 1+2+⋯+n1 + 2 + \cdots + n numbers.

Solution

Show the solution

(a) Let Rn=∑j=0n−1(n2−n+1+2j)R_n = \sum_{j=0}^{n-1} (n^2 - n + 1 + 2j). The claim is Rn=n3R_n = n^3. For n=1n = 1, R1=1=13R_1 = 1 = 1^3. Assume Rn=n3R_n = n^3. Row n+1n + 1 has n+1n + 1 terms, and its first term is (n+1)2−(n+1)+1=n2+n+1(n+1)^2 - (n+1) + 1 = n^2 + n + 1. The terms of row n+1n + 1 are n2+n+1+2jn^2 + n + 1 + 2j for 0≤j≤n0 \le j \le n. Compare the term with index jj for 0≤j≤n−10 \le j \le n - 1 with the same term of row nn: (n2+n+1+2j)−(n2−n+1+2j)=2n.(n^2 + n + 1 + 2j) - (n^2 - n + 1 + 2j) = 2n. So the first nn terms of row n+1n+1 add up to Rn+2n⋅nR_n + 2n \cdot n. The last term of row n+1n+1 has j=nj = n and equals n2+3n+1n^2 + 3n + 1. Therefore Rn+1=Rn+2n2+n2+3n+1=n3+3n2+3n+1=(n+1)3.□R_{n+1} = R_n + 2n^2 + n^2 + 3n + 1 = n^3 + 3n^2 + 3n + 1 = (n+1)^3. \quad \square

(b) The last term of row nn is n2+n−1n^2 + n - 1 and the first term of row n+1n+1 is n2+n+1n^2 + n + 1, which is the next odd number. The first row is 11. By induction on nn, the rows 1,2,…,n1, 2, \ldots, n written one after the other are the first Tn=1+2+⋯+nT_n = 1 + 2 + \cdots + n odd numbers 1,3,5,…1, 3, 5, \ldots. By eq. (2) of the text, their sum is Tn2T_n^2. By (a), the sum of row kk is k3k^3. So 13+23+⋯+n3=(1+2+⋯+n)2.□1^3 + 2^3 + \cdots + n^3 = (1 + 2 + \cdots + n)^2. \quad \square

Check

Row 44 is 13+15+17+19=64=4313 + 15 + 17 + 19 = 64 = 4^3. For n=4n = 4: 1+8+27+64=100=1021 + 8 + 27 + 64 = 100 = 10^2, and 1+2+3+4=101 + 2 + 3 + 4 = 10. The rows 11 to 44 are 1; 3,5; 7,9,11; 13,…,191;\ 3, 5;\ 7, 9, 11;\ 13, \ldots, 19, the first ten odd numbers, whose sum is 100100. A python3 run confirmed (a) for n≤29n \le 29.

Remarks

The identity of (b) also follows by induction from Tn+12−Tn2=(n+1)(Tn+1+Tn)=(n+1)3T_{n+1}^2 - T_n^2 = (n+1)(T_{n+1} + T_n) = (n+1)^3, since Tn+1+Tn=(n+1)2T_{n+1} + T_n = (n+1)^2. Nicomachus lived about A.D. 100.

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.