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

Exercise 1.2.8-41

not stated yet in Lean solution written

RatingM25
MarkersM (mathematical)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.8 of Volume 1. Companion chapter: Fibonacci numbers

The task

Show that Fk1+1+⋯+Fkr+1=⌊ϕn+ϕ−1⌋F_{k_1+1} + \cdots + F_{k_r+1} = \lfloor\phi n + \phi^{-1}\rfloor for n=Fk1+⋯+Fkrn = F_{k_1} + \cdots + F_{k_r} in the Fibonacci number system, and find the analogous formula for Fk1−1+⋯+Fkr−1F_{k_1-1} + \cdots + F_{k_r-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

Use Fk+1−ϕFk=ϕ^kF_{k+1} - \phi F_k = \hat\phi^k from Exercise 1.2.8-28, and sum over the terms.

Hint 2

Bound S=∑ϕ^kiS = \sum\hat\phi^{k_i} with geometric series, using that the indices are different and at least 22. The bound is −ϕ−2<S<ϕ−1-\phi^{-2} < S < \phi^{-1}.

Hint 3

For the second formula use Fk−1=ϕ−1Fk+ϕ^kF_{k-1} = \phi^{-1}F_k + \hat\phi^k.

Solution

Show the solution

Let n=∑iFkin = \sum_iF_{k_i} (Fibonacci system, ki≥2k_i \ge 2, distinct) and S=∑iϕ^kiS = \sum_i\hat\phi^{k_i}.

Bound for SS. Since ϕ^=−ϕ−1\hat\phi = -\phi^{-1}, the term ϕ^k\hat\phi^{k} is ϕ−k\phi^{-k} for even kk and −ϕ−k-\phi^{-k} for odd kk. The even indices are distinct and at least 22, so their terms sum to less than ϕ−2+ϕ−4+⋯=ϕ−2/(1−ϕ−2)=ϕ−1\phi^{-2} + \phi^{-4} + \cdots = \phi^{-2}/(1 - \phi^{-2}) = \phi^{-1}. The odd indices are distinct and at least 33, so their terms sum to more than −(ϕ−3+ϕ−5+⋯ )=−ϕ−3/(1−ϕ−2)=−ϕ−2-(\phi^{-3} + \phi^{-5} + \cdots) = -\phi^{-3}/(1 - \phi^{-2}) = -\phi^{-2}. (For a finite sum the inequalities are strict.) The positive part is ≥0\ge 0 and the negative part is ≤0\le 0, so

−ϕ−2<S<ϕ−1.-\phi^{-2} < S < \phi^{-1}.

First formula. By Exercise 1.2.8-28, Fk+1=ϕFk+ϕ^kF_{k+1} = \phi F_k + \hat\phi^k. Sum over the kik_i: N=∑Fki+1=ϕn+SN = \sum F_{k_i+1} = \phi n + S, an integer. Then N≤ϕn+ϕ−1N \le \phi n + \phi^{-1} because S<ϕ−1S < \phi^{-1}, and ϕn+ϕ−1<N+1\phi n + \phi^{-1} < N + 1 because ϕ−1−S<ϕ−1+ϕ−2=1\phi^{-1} - S < \phi^{-1} + \phi^{-2} = 1. So N=⌊ϕn+ϕ−1⌋N = \lfloor\phi n + \phi^{-1}\rfloor.

Second formula. From the Binet formula, Fk−1=ϕ−1Fk+ϕ^kF_{k-1} = \phi^{-1}F_k + \hat\phi^k. Summing, N′=∑Fki−1=n/ϕ+SN' = \sum F_{k_i-1} = n/\phi + S, an integer. Then N′≤(n+1)/ϕN' \le (n+1)/\phi because S<ϕ−1S < \phi^{-1}, and (n+1)/ϕ<N′+1(n+1)/\phi < N' + 1 because ϕ−1−S<1\phi^{-1} - S < 1. So

Fk1−1+⋯+Fkr−1=⌊n+1ϕ⌋=⌊nϕ−1+ϕ−1⌋.F_{k_1-1} + \cdots + F_{k_r-1} = \left\lfloor\frac{n+1}\phi\right\rfloor = \lfloor n\phi^{-1} + \phi^{-1}\rfloor.

Check

For n=100=F11+F6+F4n = 100 = F_{11} + F_6 + F_4: F12+F7+F5=144+13+5=162F_{12} + F_7 + F_5 = 144 + 13 + 5 = 162 and ⌊100ϕ+ϕ−1⌋=⌊161.803+0.618⌋=162\lfloor 100\phi + \phi^{-1}\rfloor = \lfloor 161.803 + 0.618\rfloor = 162. Also F10+F5+F3=55+5+2=62F_{10} + F_5 + F_3 = 55 + 5 + 2 = 62 and ⌊101/ϕ⌋=⌊62.42⌋=62\lfloor 101/\phi\rfloor = \lfloor 62.42\rfloor = 62. A python test for 1≤n<30001 \le n < 3000 confirms both formulas.

Remarks

The first formula says that shifting every index by 11 multiplies the number by ϕ\phi and rounds it. The second formula is used in Exercise 1.2.8-36 to count the letters bb in a Fibonacci string.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

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

Something is wrong? Report it.