2015 AMC 12B Problem 20

Attempt Problem 20 of the 2015 AMC 12B below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2015 AMC 12B solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

20.

For every positive integer n,n, let mod5(n)\operatorname{mod}_5(n) be the remainder obtained when nn is divided by 5.5. Define a function f:{0,1,2,3,}f : \{0, 1, 2, 3, \ldots\} ×{0,1,2,3,4}\times \{0, 1, 2, 3, 4\} {0,1,2,3,4}\to \{0, 1, 2, 3, 4\} recursively as follows:

f(i,j)={mod5(j+1)if i=0 and 0j4,f(i1,1)if i1 and j=0, andf(i1,f(i,j1))if i1 and 1j4. \tiny f(i, j) = \begin{cases} \operatorname{mod}_5(j + 1) & \text{if } i = 0 \text{ and } 0 \le j \le 4, \\ f(i - 1, 1) & \text{if } i \ge 1 \text{ and } j = 0, \text{ and} \\ f(i - 1, f(i, j - 1)) & \text{if } i \ge 1 \text{ and } 1 \le j \le 4. \end{cases}

What is f(2015,2)?f(2015, 2)?

00

11

22

33

44

Answer: B
Concepts:recursionpattern recognitionmodular arithmetic
Difficulty rating: 2100
Solution:

Applying the recursion from left to right in each row gives i\j01234012340123401230241303410431313511111 \begin{array}{c|ccccc} i\backslash j&0&1&2&3&4\\ \hline 0&1&2&3&4&0\\ 1&2&3&4&0&1\\ 2&3&0&2&4&1\\ 3&0&3&4&1&0\\ 4&3&1&3&1&3\\ 5&1&1&1&1&1 \end{array} If a row consists entirely of 11s, the recursion makes the next row entirely 11s as well. Hence, by induction, f(i,2)=1f(i,2)=1 for every i5.i\ge5.

Since 20155,2015 \ge 5, we get f(2015,2)=1.f(2015, 2) = 1.

Thus, the correct answer is B.

← Problem 19#19
Full Exam

Problem 20 in Other Years