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

Exercise 1.2.8-32

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 the four congruences for Fmn+r mod FnF_{mn+r} \bmod F_n, for m≥0m \ge 0, r≥0r \ge 0 and n≥1n \ge 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 eq. (6), with an extension to all integers, to show Fa+n≡Fn−1Fa(modFn)F_{a+n} \equiv F_{n-1}F_a \pmod{F_n}.

Hint 2

Apply this mm times. Use Cassini's identity to find Fn−12 mod FnF_{n-1}^2 \bmod F_n.

Hint 3

For the cases m mod 4∈{1,3}m \bmod 4 \in \{1, 3\} use the first step with a=−ra = -r to express Fn−1FrF_{n-1}F_r by Fn−rF_{n-r}.

Solution

Show the solution

Eq. (6), Fa+n=FaFn+1+Fa−1FnF_{a+n} = F_aF_{n+1} + F_{a-1}F_n, holds for all integers aa: both sides satisfy the Fibonacci rule in aa and agree at a=0,1a = 0, 1. Write P=Fn−1P = F_{n-1}. Modulo FnF_n the congruences Fn+1=Fn+Fn−1≡PF_{n+1} = F_n + F_{n-1} \equiv P and Fa−1Fn≡0F_{a-1}F_n \equiv 0 hold, so

Fa+n≡PFa(modFn)for all integers a.(1)F_{a+n} \equiv PF_a \pmod{F_n}\qquad\text{for all integers }a. \tag{1}

Powers of PP. Cassini's identity gives Fn+1Fn−1−Fn2=(−1)nF_{n+1}F_{n-1} - F_n^2 = (-1)^n. So P2≡(−1)n(modFn)P^2 \equiv (-1)^n \pmod{F_n}, and P4≡1P^4 \equiv 1.

Shifting mm times. Apply (1) to a=ra = r, then to a=r+na = r + n, and so on. By induction Fmn+r≡PmFrF_{mn+r} \equiv P^mF_r for m≥0m \ge 0. Using P2≡(−1)nP^2 \equiv (-1)^n and P4≡1P^4 \equiv 1:

  • m≡0(mod4)m \equiv 0 \pmod 4: Fmn+r≡FrF_{mn+r} \equiv F_r.
  • m≡2(mod4)m \equiv 2 \pmod 4: Fmn+r≡(−1)nFrF_{mn+r} \equiv (-1)^nF_r.
  • m≡1(mod4)m \equiv 1 \pmod 4: Fmn+r≡PFrF_{mn+r} \equiv PF_r.
  • m≡3(mod4)m \equiv 3 \pmod 4: Fmn+r≡(−1)nPFrF_{mn+r} \equiv (-1)^nPF_r.

Removing PP. Apply (1) with a=−ra = -r and use F−r=(−1)r+1FrF_{-r} = (-1)^{r+1}F_r from Exercise 1.2.8-8: Fn−r≡(−1)r+1PFrF_{n-r} \equiv (-1)^{r+1}PF_r. Multiply by (−1)r+1(-1)^{r+1}: PFr≡(−1)r+1Fn−rPF_r \equiv (-1)^{r+1}F_{n-r}. Insert this in the last two cases. For m≡1m \equiv 1 the residue is (−1)r+1Fn−r(-1)^{r+1}F_{n-r}. For m≡3m \equiv 3 it is (−1)r+1+nFn−r(-1)^{r+1+n}F_{n-r}. These are the four claimed congruences.

Check

Take n=7n = 7, F7=13F_7 = 13, r=4r = 4. For m=1m = 1: F11=89=6⋅13+11F_{11} = 89 = 6\cdot13 + 11, so 89≡1189 \equiv 11, and (−1)5F3=−2≡11(-1)^5F_3 = -2 \equiv 11. For m=3m = 3: F25=75025=5771⋅13+2F_{25} = 75025 = 5771\cdot13 + 2, and (−1)5+7F3=2(-1)^{5+7}F_3 = 2. A python search over 1≤n≤191 \le n \le 19, 0≤m≤130 \le m \le 13, 0≤r≤190 \le r \le 19 finds no violation.

Remarks

For r>nr > n the index n−rn - r is negative and the formulas hold with the extension of Exercise 1.2.8-8. The case m=2m = 2, r=0r = 0 gives F2n≡0F_{2n} \equiv 0, and the case m=4m = 4 shows that the residues of FkF_k modulo FnF_n repeat with period dividing 4n4n.

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.