Skip to main content
OlympiadHQ

Browse · MATH

Print

jmc

number theory senior

Problem

The infinite sequence is defined by and for each integer . What is the remainder when is divided by ?
Solution
Another way of writing the sequence is . We wish to determine the term of this sequence modulo .

Note that . In order to determine the remainder of when divided by , we look for a pattern in the powers of modulo . Computing a few powers of yields So we have a cyclic pattern of length (this is called a period). Now we need to determine where falls in the cycle; to do that, we must determine the residue of , since the cycle has length .

Note that Continuing in this manner, we always have . Thus, .
Final answer
3