Skip to content / Đến nội dung
ThichHocToan.com

AMC 12B năm 2015 Câu hỏi 20

AMC12 · AMC 12B năm 2015

Câu hỏi 20

Với mọi số nguyên dương $n,$ đặt $\operatorname{mod}_5(n)$ là số dư thu được khi $n$ được chia cho $5.$ Xác định hàm $f : \{0, 1, 2, 3, \ldots\}$ $\times \{0, 1, 2, 3, 4\}$ $\to \{0, 1, 2, 3, 4\}$ theo cách đệ quy như sau:

$$
\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}
$$

$f(2015, 2)?$ là gì
  1. $0$
  2. $1$
  3. $2$
  4. $3$
  5. $4$