Problem:
For every positive integer n, let mod5​(n) be the remainder obtained when n is divided by 5 . Define a function f:{0,1,2,3,…}×{0,1,2,3,4}→{0,1,2,3,4} recursively as follows:
f(i,j)=⎩⎪⎪⎨⎪⎪⎧​mod5​(j+1) if i=0 and 0≤j≤4f(i−1,1) if i≥1 and j=0, and f(i−1,f(i,j−1)) if i≥1 and 1≤j≤4​
What is f(2015,2) ?
Answer Choices:
A. 0
B. 1
C. 2
D. 3
E. 4
Solution:
Computing from the definition leads to the following values of f(i,j) for i=0,1,2,3,4,5,6 (the horizontal coordinate in the table) and j=0,1,2,3,4 (the vertical coordinate).
i/j012345​0123031​1230311​2342431​3404111​4011031​​
If follows that f(i,2)=1​ for all i≥5.
The problems on this page are the property of the MAA's American Mathematics Competitions