2007 iTest Problems/Problem 47
Problem
Let and be sequences defined as follows: ,
Let be the largest integer that satisfies all of the following conditions: , for some positive integer ; , for some positive integer ; and . Find the remainder when is divided by .