2022 AMC 12B Problems/Problem 23
Problem
Let be a sequence of numbers, where each is either or . For each positive integer , define
Suppose for all . What is the value of the sum
Solution
First, notice that
Then since is the modular inverse of 7 in , we can perform the Euclidean algorithm to find it for .
Starting with , Now, take both sides Using Fermat's Little Theorem, Thus, Therefore,
We may repeat this same calculation with to yield Now, we notice that is basically an integer expressed in binary form with bits. This gives rise to a simple inequality, Since the maximum possible number that can be generated with bits is Looking at our calculations for and , we see that the only valid integers that satisfy that constraint are