6

Consider the Fibonacci sequence $1, 1, 2, 3, 5, 8, 13, ...$ What are the last three digits (from left to right) of the $2020^{\text{th}}$ term?

The problem is taken from here. I have no idea how to approach this problem. Maybe the general term of the Fibonacci sequence will be of some use? $$F_n=\frac{(\frac{1+\sqrt{5}}{2})^n-(\frac{1-\sqrt{5}}{2})^n}{\sqrt{5}}$$

Hints are welcomed. Thanks in advance.

Y.T.
  • 1,427
  • 9
  • 20
  • 4
    Note that the last three digits of a number are determined by what it is congruent to modulo $1000$. Thinking about the simpler case of the last digit (so looking modulo $10$): can you compute several terms and spot a pattern? – Greg Martin Mar 27 '21 at 08:17
  • 2
    One could compute the terms mod 8 and mod 25. There will be periodicity for two consecutive terms. Thus periods will be at most 88=64 and 2525=625. However, this will not be a great saving over the computation mod 1000 when all we want is already term 2020th. – Wlod AA Mar 27 '21 at 08:31
  • 3
    From the linked exam it looks like you have 9 minutes per problem. You might be able to compute $$\begin{bmatrix} 1 & 1 \ 1 & 0 \end{bmatrix}^{2020} \pmod { 1000}$$ using repeated squaring in that time. Alternatively you could try finding cycles $\pmod 8$ and $\pmod {125}$ then using chinese remainder . – DanielV Mar 27 '21 at 09:52
  • There are roughly logarithmic routes ... what's the issue ? – Roddy MacPhee Mar 27 '21 at 12:05
  • 2
    @WlodAA, do you mean mod $8$ and $125$? – lhf Mar 27 '21 at 17:54
  • @Ihf, my wishful thinking made me imagine that 1000=825 -- strange but true (otherwise, all my life I knew that 1000=8125; after all, 1000 is a cube. :) ) – Wlod AA Mar 28 '21 at 03:47
  • I just found this to be a duplicate of https://math.stackexchange.com/questions/3984867/contest-problem-linked-to-fibonacci-and-number-theory?rq=1 but I think that Whatsup solution is much cleaner – Y.T. Mar 28 '21 at 03:50

1 Answers1

4

By Chinese remainder theorem, it suffices to find the result mod $8$ and mod $125$.

I assume that you know how to do it mod $8$ (by finding period).

For mod $125$, we write $$2^nF_n = \frac 1 {\sqrt 5} \left(\sum_{k = 1}^n\binom n k \sqrt 5^k - \sum_{k = 1}^n\binom n k (-\sqrt 5)^k\right) = 2\sum_{k = 0\\2\nmid k}^n\binom n k 5^\frac{k - 1}2.$$ Now we only have to compute the sum for $k = 1, 3, 5$, as all other terms are obviously multiples of $125$.

This, together with a simple calculation of $2^{2020} \mod 125$, will give you the result.

WhatsUp
  • 22,201
  • 19
  • 48