A big Fibonacci number

Consider the Fibonacci sequence, defined by the following recursion:

F 1 = F 2 = 1 , F n + 2 = F n + 1 + F n F_1=F_2=1, F_{n+2}=F_{n+1}+F_{n}

Let n = 3 5 7 n=3^{5^{7}} . Calculate the remainder of F n F_n divided by 521 521 .

Note: the answer is a nonnegative integer below 521 521 .


The answer is 34.

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.

1 solution

Ohad Klein
Sep 20, 2014

Let's start with an identitiy: F 3 n = 5 F n 3 + 3 ( 1 ) n F n F_{3n}=5F_{n}^3+3(-1)^nF_{n} .

How can we use it to solve the problem? Let n n be some power of 3 3 . n n is clearly odd. Using the identity, we get: F 3 n = 5 F n 3 3 F n F_{3n}=5F_{n}^3-3F_{n} . So, F 3 n m o d 521 F_{3n} \mod 521 is uniquely defined by F n m o d 521 F_{n} \mod 521 . Indeed, if x n = F 3 n m o d 521 x_n=F_{3^n} \mod 521 , one can verify that x 0 = 1 = x 3 x_0=1=x_3 (it's easy to calculate x 3 x_3 using the identity and a calculator). Hence, x n x_n has a period of 3, and x 5 7 = x 2 = F 9 = 34 x_{5^7}=x_{2}=F_{9}=34 .

There are probably many ways to prove the identity, here is one sketch: (it is just a straightforward proof. nothing interesting.)

Start with proving that for any n , k n,k the following holds: F m = F k F m + 1 k + F k 1 F m k F_{m}=F_{k}F_{m+1-k}+F_{k-1}F_{m-k} . It can be done by a trivial induction on k.

Put m = 3 n , k = n m=3n,k=n and get F 3 n = F n F 2 n + 1 + F n 1 F 2 n F_{3n}=F_{n}F_{2n+1}+F_{n-1}F_{2n} .

In the same manner, derive the following identities:

F 2 n = F n ( F n + 1 + F n 1 ) F_{2n}=F_{n}(F_{n+1}+F_{n-1})

F 2 n + 1 = F n 2 + F n + 1 2 F_{2n+1}=F_{n}^2+F_{n+1}^2

Put everything together: F 3 n = F n ( F n 2 + F n + 1 2 ) + F n 1 F n ( F n + 1 + F n 1 ) F_{3n}=F_{n}(F_{n}^2+F_{n+1}^2)+F_{n-1}F_{n}(F_{n+1}+F_{n-1}) .

If we divide F 3 n F_{3n} by F n F_{n} , we get: F n 2 + F n + 1 2 + F n 1 ( F n + 1 + F n 1 ) F_{n}^2+F_{n+1}^2+F_{n-1}(F_{n+1}+F_{n-1}) .

Do some algebra and show it equals to 2 F n 2 + 3 F n 1 F n + 1 2F_{n}^2+3F_{n-1}F_{n+1} .

Now, prove by induction that F n + 1 F n 1 = F n 2 + ( 1 ) n F_{n+1}F_{n-1}=F_{n}^2+(-1)^n , and you're done.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...