The function $\mathrm{f}$ on the positive integers satisfies $\mathrm{f}(1)=1, \mathrm{f}(2 \mathrm{n}+1)=\mathrm{f}(2 \mathrm{n})+1$ and $\mathrm{f}(2 \mathrm{n})=3$ $f(n)$. Find the set of all $m$ such that $m=f(n)$ for some $n$.
We show that to obtain $\mathrm{f}(\mathrm{n})$, one writes $\mathrm{n}$ in base 2 and then reads it in base 3. For example 12 $=1100_{2}$, so $f(12)=1100_{3}=36$. Let $g(n)$ be defined in this way. Then certainly $g(1)=1$. Now $2 n+1$ has the same binary expansion as $2 n$ except for a final 1, so $g(2 n+1)=g(2 n)+1$. Similarly, $2 \mathrm{n}$ has the same binary expansion as $\mathrm{n}$ with the addition of a final zero. Hence $g(2 n)=3 g(n)$. So $g$ is the same as f. Hence the set of all $m$ such that $m=f(n)$ for some $n$ is the the set of all $\mathrm{m}$ which can be written in base 3 without a digit 2.