Greatest common divisor of Fibonnacci numbers

The Fibonacci sequence is defined by F 1 = 1 , F 2 = 1 F_1 = 1, F_2 = 1 and F n + 2 = F n + 1 + F n F_{n+2} = F_{n+1} + F_{n} for n 1 n \geq 1 .

Find the greatest common divisor of F 484 F_{484} and F 2013 F_{2013} .


The answer is 89.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

17 solutions

Ruslan Vu
May 20, 2014

Euclidean algorithm: If a = b t + r a = bt + r , for integers t t and r r , then gcd ( a , b ) = gcd ( b , r ) \gcd(a, b) = \gcd(b, r) .

By Euclidean algorithm, we deduce that f n f_n and f n + 1 f_{n+1} are coprime integers, using induction: f n + 1 = f n 1 + f n 1 gcd ( f n + 1 , f n ) = gcd ( f n , f n 1 ) = gcd ( f n 1 , f n 2 ) = . . . = gcd ( f 2 , f 1 ) = 1 f_{n+1} = f_n * 1 + f_{n-1} \Rightarrow \gcd (f_{n+1}, f_n) = \gcd (f_n, f_{n-1}) = \gcd ( f_{n-1}, f_{n-2}) = ... = \gcd (f_2, f_1) = 1 .

By Binet formula for Fibonacci numbers, we deduce that f m + n = f m f n + 1 + f n f m 1 f_{m+n} = f_m * f_{n+1} + f_n * f_{m-1}

By those two lemmas, we deduce that: \begin{array}{l l l} \gcd(f_m, f_{m+n}) & = \gcd(f_m; f_m * f_{n+1} + f_n * f_{m-1}) & \mbox{(binet formula)} \\ & = \gcd(f_m; f_n * f_{m-1}) & \mbox{ (euclidean algorithm)} \\ & = \gcd(f_m; f_n) & \mbox{(since f_m and f_{m-1} are coprime)}\\ \end{array}

We can continue reducing the indices until we reach gcd ( f i ; f i ) \gcd(f_i;f_i) (proceed and we get f_0). Now we can declare that gcd ( f m ; f n ) = f i \gcd(f_m; f_n) = f_i , and by the way we reduced the indices, we can conclude that i = gcd ( m , n ) i = \gcd(m,n) . Hence, gcd ( f m ; f n ) = f gcd ( m , n ) \gcd(f_m; f_n) = f_{\gcd(m,n)} , so

gcd ( f 484 ; f 2013 ) = f gcd ( 484 ; 2013 ) = f 11 = 89 \gcd (f_{484}; f_{2013}) = f_{\gcd(484 ;2013)} = f_{11} = 89 .

[Latex edits]

All submitted solutions were correct. This was one of the select few that actually included a proof of the GCD property of the Fibonacci numbers, rather than just citing it.

Calvin Lin Staff - 7 years ago
Rahul Nahata
May 20, 2014

An interesting property of Fibonacci Numbers is that: gcd ( a m , a n ) = a gcd ( m , n ) \mbox{gcd}(a_{m},a_{n})=a_{\text{gcd}(m,n)} .
Here a n a_{n} denotes n t h {n^{th} } Fibonacci Number.
It's proof is based on four lemmas
*Lemma 1: * For integers n , m n,m , gcd ( m , n ) = gcd ( m , n ± m ) \mbox{gcd}(m, n) = \mbox{gcd}(m, n\pm m) .
This because any common factor of n , m n,m is also a factor of n ± m n\pm m
*Lemma 2: * For n > 0 n\gt 0 , gcd ( a n , a n 1 ) = 1 \mbox{gcd}(a_{n}, a_{n-1}) = 1
In other words, any two consecutive Fibonacci numbers are mutually prime. It can be easily proved by induction and Lemma 1.
*Lemma 3: * Assume, gcd ( m , n ) = 1 \mbox{gcd}(m,n)=1 , then gcd ( m , n k ) = gcd ( n , k ) \mbox{gcd}(m,nk)=\mbox{gcd}(n,k) .
This is because any mutual factor of m m and n k nk divides k k , because it can't divide n n .
*Lemma 4: * a m + n = a m a n + 1 + a m 1 a n . a_{m+n} = a_{m}a_{n+1} + a_{m-1}a_{n}. . For its proof visit here



Now proving the main proposition:

Let then n = m k + r n = mk + r , 0 r < m 0 \le r \lt m . We have

gcd ( a m , a n ) = gcd ( a m k + 1 a r + a m k a r 1 ) d u e t o Lemma 4 = gcd ( a m , a m k + 1 a r ) b e c a u s e a m a m k = gcd ( a m , a r ) d u e t o Lemma 3. \begin{array}{rll} \mbox{gcd}(a_{m},a_{n}) &= \mbox{gcd}(a_{mk+1}a_{r}+a_{mk}a_{r-1}) & \space due \space to \space \mbox{Lemma} \space 4 \\ &=\mbox{gcd}(a_{m},a_{mk+1}a_{r}) & \space because \space a_m|a_{mk} \\ &=\mbox{gcd}(a_{m},a_{r}) & \space due \space to \space \mbox{Lemma} \space 3. \end{array}

If we lose the functional symbol a a_{} , the subscripts form a step in Euclid's algorithm. As there, the process can continue until the remainder r r becomes zero. At this step we claim that the previous (the last non-zero) remainder is exactly the greatest common divisor of the two original numbers. What we showed so far is that applying Euclid's algorithm to a m a_m and a n a_n goes exactly in parallel with applying it to the subscripts. So when eventually we arrive at, say, gcd ( m , n ) = gcd ( s , 0 ) \mbox{gcd}(m,n)=\mbox{gcd}(s,0) , and declare that gcd ( m , n ) = s \mbox{gcd}(m,n)=s , we can at the same time to declare that gcd ( a m , a n ) = gcd ( a s , 0 ) \mbox{gcd}(a_{m},a_{n})=\mbox{gcd}(a_{s},0) and, hence, that gcd ( a m , a n ) = gcd ( a s , 0 ) = a s = a gcd ( m , n ) \mbox{gcd}(a_{m},a_{n})=\mbox{gcd}(a_{s},0)=a_{s}=a_{\text{gcd}(m,n)} .

Now the problem is to find gcd ( a 484 , a 2013 ) \mbox{gcd}(a_{484},a_{2013}) which will be equal to a gcd ( 484 , 2013 ) = a 11 = 89 a_{\text{gcd}(484,2013)} = a_{11} = 89

Dae Ho Han
May 20, 2014

Observe the recursion formula: a n = a n 1 + a n 2 = 2 a n 2 + a n 3 = 3 a n 3 + 2 a n 4 a_{n} = a_{n-1}+a_{n-2} = 2a_{n-2}+a_{n-3} = 3a_{n-3}+2a_{n-4} = = a m + 1 a n m + a m a n m 1 = \cdots = a_{m+1}a_{n-m}+a_{m}a_{n-m-1} ----(1)

Let ( a , b ) (a,b) means the greatest common divisor of a a and b b .

( a n , a n + 1 ) = ( a n + 1 a n , a n ) = ( a n 1 , a n ) = = ( a 1 , a 2 ) = ( 1 , 1 ) = 1 (a_{n}, a_{n+1}) = (a_{n+1}-a_{n}, a_{n}) = (a_{n-1}, a_{n}) = \cdots = (a_{1}, a_{2}) = (1, 1) = 1 Therefore, the consecutive terms are coprime numbers.

By (1), a 2013 = a 1530 a 484 + a 1529 a 483 a_{2013} = a_{1530}a_{484} + a_{1529}a_{483}

By Euclidean algorithm, ( a 484 , a 2013 ) = ( a 484 , a 1529 a 483 ) = ( a 484 , a 1529 ) (a_{484}, a_{2013}) = (a_{484}, a_{1529}a_{483}) = (a_{484}, a_{1529})

( \because a 483 a_{483} and a 484 a_{484} are coprime numbers as we showed it.)

By watching this process carefully, we can understand that ( a B , a A ) = ( a B , a r ) (a_{B}, a_{A}) = (a_{B}, a_{r}) provided that A B A \geq B and r r is the remainder when A A is divided by B B .

Apply this in calculation: ( a 484 , a 2013 ) = ( a 484 , a 77 ) = ( a 22 , a 77 ) = ( a 22 , a 11 ) = a 11 = 89 (a_{484}, a_{2013}) = (a_{484}, a_{77}) = (a_{22}, a_{77}) = (a_{22}, a_{11}) = a_{11}= 89

cf. In the algorithm, we can define a 0 = 0 a_{0} = 0 .

GCD of two fibonacci numbers is simply the fibonacci number of GCD of that two numbers.. i.e. GCD of Fn and Fm will be F(gcd of m and n). Gcd of 484 and 2013 is 11. Hence ans is F11 = 89.

True..

Please take care of latex though.. :)

Snehal Shekatkar - 7 years, 5 months ago
Matthew Nelson
May 20, 2014

Because the Fibonacci Sequence satisfies g c d ( F m , F n ) = F gcd ( m , n ) gcd(F_m,F_n) = F_{\gcd(m,n)} then we need only find the greatest common divisor of 484 and 2013. Looking at the prime factorizations:

2013 = 3 11 61 2013=3*11*61

484 = 2 2 11 11 484=2*2*11*11

We can find the greatest common divisor by listing all the prime factors they have in common. In this case the only prime factor they have in common is 11.

That does not mean the gcd of the two terms is 11, but that F 11 F_{11} will be our gcd.

After making a short list of the Fibonacci Sequence:

1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 89... 1,1, 2, 3, 5, 8, 13, 21, 34, 55, 89...

We see that 89 will be our greatest common divisor.

x2, because the gcd result is used, not proven

Calvin Lin Staff - 7 years ago
Manoj Pandey
May 20, 2014

The Fibonacci Sequence is an example of Divisibility Sequence

Thus,

g c d ( F m , F n ) = F g c d ( m , n ) gcd(F_m,F_n)=F_{gcd(m,n)}

We have to find g c d ( a 484 , a 2013 ) gcd (a_{484},a_{2013}) which is same as a g c d ( 484 , 2013 ) a_{gcd(484,2013)}

So, g c d ( 484 , 2013 ) = 11 gcd(484,2013)=11 .

Now we have to find a 11 a_{11} which is the answer to our question.

a 11 a_{11} can be easily calculated out as 89 89 .

Hence g c d ( a 484 , a 2013 ) gcd (a_{484},a_{2013}) = 89 89

Only x2 because it is not shown the Fibonacci numbers form a strong divisibility sequence

Calvin Lin Staff - 7 years ago

So that we can find the desired value, we must use the following formula:

GCD ( a m , a n ) = a GCD ( m , n ) , \text{GCD} (a_{m},a_n) = a_{\text{GCD}(m,n)}, which was tested in 1876 by ​​the mathematician F. Edouard. A. Lucas (a demonstration (in portuguese) is in the 2.5 section of here , whence we have:

GCD ( a 2013 , a 484 ) = a GCD ( 2013 , 484 ) \text{GCD}(a_{2013},a_{484}) = a_{\text{GCD}(2013,484)}

Let's calculate the GCD ( 2013 , 484 ) , \text{GCD}(2013,484), for this, we'll use the Euclidean Algorithm:

GCD ( 2013 , 484 ) = GCD ( 2013 4 484 , 484 ) = GCD ( 77 , 484 ) = GCD ( 77 , 484 6 77 ) = GCD ( 77 , 22 ) = 11 \\ \text{GCD}(2013,484) = \text{GCD}(2013-4 \cdot 484,484) \\ = \text{GCD}(77,484) = \text{GCD}(77,484-6 \cdot 77) \\ = \text{GCD}(77,22) = 11

Whence we have a GCD ( 2013 , 484 ) = a 11 = 89. a_{\text{GCD}(2013,484)}=a_{11} = 89. Therefore:

GCD ( a 2013 , a 484 ) = 89 \text{GCD}(a_{2013},a_{484}) = 89

This number (89) is the desired result.

x2, because the proof is just cited, not included

Calvin Lin Staff - 7 years ago
Yuchen Liu
May 20, 2014

For this question we can use the theorem gcd ( f m , f n ) = f gcd ( m , n ) \gcd(f_{m},f_{n}) = f_{\gcd(m,n)}

Thus the answer to this question is gcd ( a 484 , a 2013 ) = a gcd ( 484 , 2013 ) = a 11 = 89 \gcd(a_{484},a_{2013}) = a_{\gcd(484,2013)} = a_{11} = 89

A well-substantiated proof of the theorem used above can be found at the link GCD of Fibonnacci numbers

Not x3, because the proof of the GCD formula is not included

Calvin Lin Staff - 7 years ago
Nicholas Tomlin
Dec 22, 2013

The GCD of any two Fibonacci numbers f x f_x and f y f_y is f gcd ( f x , f y ) f_{\gcd{(f_x,f_y)}} . Therefore, the GCD of f 484 f_{484} and f 2013 f_{2013} is f 11 = 89 f_{11} = \boxed{89} .

Rama Devi
May 28, 2015

Santanu Banerjee
Dec 30, 2013
Pranshu Gaba
Dec 19, 2013

Let's observe the first few Fibonacci numbers.

F 1 = 1 F_1 = 1

F 2 = 1 F_2 = 1

F 3 = 2 F_3 = 2

F 4 = 3 F_4 = 3

F 5 = 5 F_5 = 5

F 6 = 8 F_6 = 8

F 7 = 13 F_7 = 13

F 8 = 21 F_8 = 21

F 9 = 34 F_9 = 34

F 10 = 55 F_{10} = 55

F 11 = 89 F_{11} = 89

F 12 = 144 F_{12} = 144

F 13 = 233 F_{13} = 233

F 14 = 377 F_{14} = 377

\vdots

and so on.

From the above list, I observed (but couldn't prove it properly) that gcd ( F a , F b ) = F gcd ( a , b ) \textrm{gcd}(F_a, F_b) = F_{\textrm{gcd}(a, b)}

So, gcd ( F 484 , F 2013 ) = F gcd ( 484 , 2013 ) \textrm{gcd}(F_{484}, F_{2013}) = F_{\textrm{gcd}(484, 2013)}

= F 11 = F_{11}

= 89 =\boxed{89}


Proof : In the list of Fibonacci Numbers, we see an amazing pattern.

F 3 , F 6 , F 9 , F 12 , F 3 n F_{3}, F_{6}, F_{9}, F_{12}, \ldots F_{3n} are divisible by F 3 F_{3} , i.e. 2 2 ( n N ) (n \in \mathbb{N})

Similarly,

F 4 , F 8 , F 12 , F 16 , F 4 n F_{4}, F_{8}, F_{12}, F_{16}, \ldots F_{4n} are divisible by F 4 F_{4} , i.e. 3 3 ( n N ) (n \in \mathbb{N})

Similarly,

F 5 , F 10 , F 15 , F 20 , F 5 n F_{5}, F_{10}, F_{15}, F_{20}, \ldots F_{5n} are divisible by F 5 F_{5} , i.e. 5 5 ( n N ) (n \in \mathbb{N})

This pattern can be generalized.

F k , F 2 k , F 3 k , F 4 k , F_{k}, F_{2k}, F_{3k}, F_{4k}, \ldots will be divisible by F k F_{k} ( k N ) (k \in \mathbb{N})


Now let's take any two Fibonacci numbers F a F_{a} and F b F_{b}

The prime factorization of a a would be l \phantom{l} 2 p 3 q 5 r 2^p \cdot 3^q \cdot 5^r \ldots

Similarly, the prime factorization of b b would be l \phantom{l} 2 x 3 y 5 z 2^x \cdot 3^y \cdot 5^z \ldots

Suppose gcd ( a , b ) = 2 x 3 q 5 z \textrm{gcd}(a, b) = 2^x \cdot 3^q \cdot 5^z \ldots .


F a F_{a} would be divisible with F 2 p , F 3 q , F 5 r F_{2^p}, F_{3^q}, F_{5^r} \ldots

Similarly, F b F_{b} would be divisible with F 2 x , F 3 y , F 5 z F_{2^x}, F_{3^y}, F_{5^z} \ldots

Therefore gcd ( F a , F b ) \textrm{gcd}(F_a, F_b) will be divisible by F 2 x , F 3 q , F 5 z F_{2^x}, F_{3^q}, F_{5^z} \ldots

gcd ( F a , F b ) = F 2 x 3 q 5 z \textrm{gcd}(F_a, F_b) = F_{2^x \cdot 3^q \cdot 5^z} \ldots

gcd ( F a , F b ) = F gcd ( a , b ) \textrm{gcd}(F_a, F_b) = F_{\textrm{gcd}(a, b)}

See proof here

Happy Melodies - 7 years, 5 months ago

Log in to reply

Nice reference, thank you!

Alexander Borisov - 7 years, 5 months ago

Log in to reply

Your welcome :)

Happy Melodies - 7 years, 5 months ago

courtesy of wikipedia: gcd( F(m), F(n) ) = F( gcd(m, n) )

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def gcd(a, b):
    if a < b:
        spam = a
    else:
        spam = b
    while spam > 0:
        if a%spam == 0 and b%spam == 0:
            return spam
        spam -= 1
    return 1 

def fib(n):
    x = z = 0
    y = 1
    while n > 1:
        z = x+y
        x = y
        y = z
        n -= 1
    return y    

print fib(gcd(484, 2013))    

Answer: 89

Greatest common divisor formula for Fibonacci numbers are,

gcd(Fm, Fn) = F(gcd(m,n))

In this case GCD(484, 2013)=11 and 11th Fibonacci number is 89. So this is the answer.

The proof for this formula can be found here: http://www.math.hmc.edu/funfacts/ffiles/20004.5.shtml

Sayantan Guha
Dec 20, 2013

We use the following result: For For m,n≥1, gcd(f {m},f {n})=f {gcd(m,n)} Here m=484, n=2013 gcd(484,2013)=11 f {11} = 89

Thanic Samin
Dec 20, 2013

g c d ( f m , f n ) = f g c d ( m , n ) . gcd(f_{m},f_{n})=f_{gcd(m,n)}.

g c d ( 484 , 2013 ) = 11 gcd(484, 2013)=11 , so the ans is f 11 = 89 f_{11}=\boxed{89}

G C D ( F m , F n ) = F G C D ( m , n ) GCD(F_{m}, F_{n}) = F_{GCD(m,n)}

G C D ( 484 , 2013 ) = 11 GCD(484, 2013) = 11

F 11 = 89 F_{11} = 89

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...