find a map which satisfies the following

19 Views Asked by At

hey I have to find a map, which works like this: map $f$ must map $$0 \to (0,0), 1 \to (0,1),2 \to (0,2), 3 \to (1,0), 4 \to (1,1), 5 \to (1,2), 6 \to (2,0), 7\to(2,1)$$ and finally $ 8\to (2,2)$. I was thinking something like $f(i) \to (i \mod 3, i+1\mod 3)$ would work, but there are some exceptions... does anyone have any idea?

1

There are 1 best solutions below

3
On BEST ANSWER

If by finding a "map", you mean finding a rule of correspondence, then here is one answer:

$f:\{0,1,...,8\}\rightarrow\mathbb N: f(i)=(\lfloor i/3 \rfloor, i \mod 3)$