Skip to main content
OlympiadHQ

Browse · MATH

Print

jmc

number theory senior

Problem

Two sequences and are defined as follows: What is the remainder when is divided by ?
Solution
The problem is greatly simplified by defining the sequence as for all nonnegative integers . Then and . Additionally, for integers we have This is convenient since we want to determine the remainder of . Thus, we no longer have to think about the sequences and , but only about .

The first few terms of are . When reduced modulo , these terms are . The first four terms are . These continue repeating because the next two terms are and all terms are defined as the sum of the preceding two. Since the cycle has length and , we have and thus .
Final answer
4