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

Exercise 1.2.8-27

not stated yet in Lean solution written

RatingM20
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 for a prime p≠5p \ne 5 exactly one of Fp−1F_{p-1} and Fp+1F_{p+1} is a multiple of pp.

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 treat p=2p = 2 by hand. For odd pp use Exercise 1.2.8-26 to find Fp2 mod pF_p^2 \bmod p.

Hint 2

Use Cassini's identity, eq. (4), for Fp+1Fp−1F_{p+1}F_{p-1}, and then the relation of Fp+1F_{p+1} and Fp−1F_{p-1} to FpF_p.

Solution

Show the solution

The case p=2p = 2. F1=1F_1 = 1 and F3=2F_3 = 2. Exactly one of them, F3F_3, is a multiple of 22.

Odd p≠5p \ne 5. By Exercise 1.2.8-26, Fp≡5(p−1)/2F_p \equiv 5^{(p-1)/2}. Squaring gives Fp2≡5p−1≡1(modp)F_p^2 \equiv 5^{p-1} \equiv 1 \pmod p, by Fermat's theorem, because pp does not divide 55. Cassini's identity with pp odd reads Fp+1Fp−1=Fp2+(−1)p=Fp2−1F_{p+1}F_{p-1} = F_p^2 + (-1)^p = F_p^2 - 1. So pp divides Fp+1Fp−1F_{p+1}F_{p-1}. Since pp is prime, it divides one of the two factors.

It cannot divide both. The difference is Fp+1−Fp−1=FpF_{p+1} - F_{p-1} = F_p, and Fp2≡1F_p^2 \equiv 1 shows that pp does not divide FpF_p.

Check

For p=7p = 7: F6=8F_6 = 8 and F8=21F_8 = 21. Only F8F_8 is a multiple of 77. For p=11p = 11: F10=55F_{10} = 55 is a multiple of 1111 and F12=144F_{12} = 144 is not. For p=13p = 13: F12=144F_{12} = 144 is not and F14=377=13⋅29F_{14} = 377 = 13\cdot29 is. For p=3p = 3: F4=3F_4 = 3 is a multiple of 33 and F2=1F_2 = 1 is not.

Remarks

Which of the two numbers is the multiple depends on p mod 5p \bmod 5: for p≡±1(mod5)p \equiv \pm1 \pmod 5 it is Fp−1F_{p-1}, and for p≡±2(mod5)p \equiv \pm2 \pmod 5 it is Fp+1F_{p+1}. The examples above agree: p=11p = 11 gives F10F_{10}, p=7p = 7 gives F8F_8. For p=5p = 5 the number F5=5F_5 = 5 is a multiple of 55 itself.

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.