2015 AMC 12B Problem 20

Below is the professionally curated solution for Problem 20 of the 2015 AMC 12B, 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 of the real AMC 8, AMC 10, AMC 12, and AIME problems in our complete solution collection are used with official legal permission of the Mathematical Association of America (MAA).

Concepts:recursionpattern recognitionmodular arithmetic

Difficulty rating: 2100

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,}×{0,1,2,3,4}{0,1,2,3,4}f : \{0, 1, 2, 3, \ldots\} \times \{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. 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

Solution:

Computing f(i,j)f(i, j) row by row from the definition, the column j=2j = 2 stabilizes: f(i,2)=1f(i, 2) = 1 for all i5.i \ge 5.

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

Thus, the correct answer is B.

Problem 20 in Other Years