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

Exercise 1.2.8-34

not stated yet in Lean solution written

RatingM24
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

Prove that every positive integer is in exactly one way a sum of Fibonacci numbers Fk1+⋯+FkrF_{k_1} + \cdots + F_{k_r} with k1≥k2+2k_1 \ge k_2 + 2, …\ldots, kr−1≥kr+2k_{r-1} \ge k_r + 2 and kr≥2k_r \ge 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

First bound the sum of any such representation by the next Fibonacci number.

Hint 2

For existence take the largest Fibonacci number that does not exceed nn. For uniqueness compare the largest terms of two representations.

Solution

Show the solution

Call a finite list k1>k2>⋯>kr≥2k_1 > k_2 > \cdots > k_r \ge 2 with gaps at least 22 admissible.

Bound. For an admissible list, Fk1+⋯+Fkr<Fk1+1F_{k_1} + \cdots + F_{k_r} < F_{k_1+1}. Induction on rr. For r=1r = 1 it is Fk1<Fk1+1F_{k_1} < F_{k_1+1}, true because Fk1−1≥1F_{k_1-1} \ge 1. For r>1r > 1 the induction hypothesis gives Fk2+⋯+Fkr<Fk2+1F_{k_2} + \cdots + F_{k_r} < F_{k_2+1}, and k2+1≤k1−1k_2 + 1 \le k_1 - 1. So the sum is less than Fk1+Fk1−1=Fk1+1F_{k_1} + F_{k_1-1} = F_{k_1+1}.

Existence, by induction on nn. For n=1n = 1 use F2=1F_2 = 1. For n>1n > 1 let kk be the largest index with Fk≤nF_k \le n, so k≥2k \ge 2 and n<Fk+1n < F_{k+1}. If n=Fkn = F_k, the list (k)(k) is the representation. Otherwise 0<n−Fk<Fk+1−Fk=Fk−10 < n - F_k < F_{k+1} - F_k = F_{k-1}. By induction n−Fkn - F_k has an admissible list. Its largest term Fk′F_{k'} satisfies Fk′≤n−Fk<Fk−1F_{k'} \le n - F_k < F_{k-1}, so k′<k−1k' < k - 1, that is, k′≤k−2k' \le k - 2. Put kk in front of this list. The result is admissible.

Uniqueness. Let two admissible lists have the sum nn, with first indices k1k_1 and k1′k_1', and suppose k1<k1′k_1 < k_1'. By the bound n<Fk1+1≤Fk1′≤nn < F_{k_1+1} \le F_{k_1'} \le n, a contradiction. So k1=k1′k_1 = k_1'. Remove Fk1F_{k_1} from both. The remaining lists are admissible with the same sum n−Fk1n - F_{k_1}, and by induction on nn they are equal. (If the sum is 00, both lists are empty, because every term is at least 11.)

Check

For n=100n = 100: F11=89F_{11} = 89, and 100−89=11100 - 89 = 11; F6=8F_6 = 8, and 11−8=3=F411 - 8 = 3 = F_4. So 100=F11+F6+F4100 = F_{11} + F_6 + F_4. For n=1000n = 1000: 987+13=F16+F7987 + 13 = F_{16} + F_7. A python search over all admissible index sets with sum at most 300300 finds exactly one set for every nn in 1≤n≤3001 \le n \le 300.

Remarks

This is the Zeckendorf representation. The same argument works for the numbers 1,2,4,8,…1, 2, 4, 8, \ldots (the binary system) with the bound 1+2+⋯+2k−1<2k1 + 2 + \cdots + 2^{k-1} < 2^k. Exercises 1.2.8-35, 1.2.8-37 and 1.2.8-41 use this system.

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.