Take a test Sign in 中文
← Exercise 949 →
Search
Go to
{{searchResults.length}} {{searchResults.length === 1 ? 'result' : 'results'}} for “{{searchWords}}” No results found for “{{searchWords}}” × back to contents
Contents · by chapter
Digits (38)
Primes (31)
Fractions, Decimals, and the Floor Function (18)
Divisors, GCD, and LCM (36)
Divisibility (59)
Bases (15)
Modular Arithmetic (42)
Integer Equations (27)

Exercises and their solutions

Exercise 949
For every nonnegative integer $n$, let $\text{mod}_3(n)$ be the remainder when $n$ is divided by $3$. Define $f:\{0,1,2,\dots\}\times\{0,1,2\}\to\{0,1,2\}$ by $f(0,j)=\text{mod}_3(j+1)$ for $0\le j\le2$, $f(i,0)=f(i-1,1)$ for $i\ge1$, and $f(i,j)=f(i-1,f(i,j-1))$ for $i\ge1$, $1\le j\le2$. What is $f(2025,2)$?
← Back to Problem 949
Solution
  1. $f(1,j)=f(0,f(1,j-1))\equiv f(1,j-1)+1\pmod3$ with $f(1,0)=f(0,1)=2$, so $f(1,\cdot)=2,0,1$. Then $f(2,j)=f(1,f(2,j-1))\equiv f(2,j-1)+2\pmod3$ with $f(2,0)=f(1,1)=0$, so $f(2,\cdot)=0,2,1$.
  2. $f(3,0)=f(2,1)=2$, $f(3,1)=f(2,2)=1$, $f(3,2)=f(2,1)=2$: $f(3,\cdot)=2,1,2$. Then $f(4,0)=f(3,1)=1$, $f(4,1)=f(3,1)=1$, $f(4,2)=f(3,1)=1$, so $f(4,\cdot)=1,1,1$.
  3. If $f(i-1,\cdot)\equiv1$, then $f(i,0)=f(i-1,1)=1$ and $f(i,j)=f(i-1,1)=1$, so $f(i,\cdot)\equiv1$ for all $i\ge4$. Hence $f(2025,2)=\boxed{1}$.
Search Go to Prev      Next

Contact Us

Thanks! Your message has been sent.
By year