I came accross this problem a while ago at school during a math contest. I dont remember the exact instruction (word for word) but it went something like :

Randomed A and B, 2 natural integer $\in [0,100]$ , Start a Fibonacci-like sequence.

A + B => C
B + C => D

If the sum goes stricly above 100, trim the first digit(leaving only the tens and units) and go on. Proove that no matter what are the two random numbers at start, the sequence will repeat itself at some point.

I thought at the time that the Pigeonhole principle could help me proove this easily but I never achieved it. Any help on this problem would be great. Sorry for the lack of mathematical vocabulary, english isn't my native langage and technical vocabulary is hard to use correctly.

  • $\begingroup$ Whenever you have a pair $(a_n,\, a_{n-1})$ that you've seen before, you found a loop. How many possible pairs are there? $\endgroup$ Commented Jul 31, 2013 at 14:15
  • $\begingroup$ i Count 101² of them $\endgroup$ Commented Jul 31, 2013 at 14:26

2 Answers 2


Look at the sequence of couples of consecutive terms. Observe that given two numbers $(a,b)$, the rest of the sequence is fully determined; therefore, it is sufficient to prove that no matter what are the initial two numbers, as some point you will fall back to two successive terms of the sequence $(a^\prime,b^\prime)$ previously encountered. Then the pigeonhole principle applies, since your numbers are always in $\{0,\dots,100\}$ — you have only $101^2$ possible different couples $(a,b)$, but your sequence of couples has infinitely many terms.

  • $\begingroup$ How do you count 101² different couple ? I counted $99!$, what did I do wrong ? $\endgroup$ Commented Jul 31, 2013 at 14:23
  • $\begingroup$ @WizardLizard, in the couple $(a, b)$, $a$ and $b$ must come from $\{0, \ldots, 100\}$; hence, there are $101$ possibilities for each, and $101^{2}$ possible different couples. However, even if it were $99!$, that's still finite. $\endgroup$ Commented Jul 31, 2013 at 14:26
  • $\begingroup$ oh god I don't know how i counted that ><. Thanks a lot for the clarification. thanks for the clear and fast answer ! $\endgroup$ Commented Jul 31, 2013 at 14:30

The sequence will repeat itself. This is the pisano period of the integer $n=100$ (assuming that you disallow $a,b=100$).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .