Maths WorkshopMaths problems with full solutions
Exercise 1999Number theory › Divisibility and gcdOlympiadAdded 5 Nov 2026

gcd(F_m, F_n) = F_gcd(m,n)

#Fibonacci numbers#gcd#Euclidean algorithm#divisibility sequences

Statement

Let F0=0F_0=0, F1=1F_1=1, Fk+2=Fk+1+FkF_{k+2}=F_{k+1}+F_k. Prove that for all positive integers m,nm,n,
gcd⁡(Fm,Fn)=Fgcd⁡(m,n).\gcd(F_m,F_n)=F_{\gcd(m,n)}.

Hint

Prove first the addition formula Fa+b=FaFb+1+Fa−1FbF_{a+b}=F_aF_{b+1}+F_{a-1}F_b, and that consecutive Fibonacci numbers are coprime. Then imitate the Euclidean algorithm.

Show solutionHide solution

Solution

Step 1: addition formula. For a≥1a\ge1 and b≥0b\ge0: Fa+b=FaFb+1+Fa−1FbF_{a+b}=F_aF_{b+1}+F_{a-1}F_b. Induction on bb.

Step 2: consecutive terms are coprime. gcd⁡(Fk+1,Fk)=gcd⁡(Fk−1,Fk)=⋯=gcd⁡(F1,F0)=1\gcd(F_{k+1},F_k)=\gcd(F_{k-1},F_k)=\dots=\gcd(F_1,F_0)=1.

Step 3: subtractive Euclid. Let m>n≥1m>n\ge1. Apply the formula with a=m−n≥1a=m-n\ge1, b=nb=n:
Fm=Fm−nFn+1+Fm−n−1Fn.F_m=F_{m-n}F_{n+1}+F_{m-n-1}F_n.
Hence gcd⁡(Fm,Fn)=gcd⁡(Fm−nFn+1,Fn)\gcd(F_m,F_n)=\gcd(F_{m-n}F_{n+1},F_n). Since gcd⁡(Fn+1,Fn)=1\gcd(F_{n+1},F_n)=1 (Step 2), any common divisor of Fm−nFn+1F_{m-n}F_{n+1} and FnF_n is a common divisor of Fm−nF_{m-n} and FnF_n, so
gcd⁡(Fm,Fn)=gcd⁡(Fm−n,Fn).\gcd(F_m,F_n)=\gcd(F_{m-n},F_n).

Step 4: conclusion. Applying Step 3 repeatedly mimics the subtractive Euclidean algorithm on the indices; it ends at (d,d)(d,d) with d=gcd⁡(m,n)d=\gcd(m,n), and gcd⁡(Fd,Fd)=Fd\gcd(F_d,F_d)=F_d.

Check. gcd⁡(F12,F18)=gcd⁡(144,2584)=8=F6\gcd(F_{12},F_{18})=\gcd(144,2584)=8=F_6.

Remark. Consequently, if FnF_n is prime then nn is prime, or n=4n=4.

Lesson. A sequence with the "addition formula" structure inherits the Euclidean algorithm on its indices.