Problem
Robert is playing a game with numbers. If he has the number $x$, then in the next move, he can do one of the following:
- Replace $x$ by $\lceil{\frac{x^2}{2}}\rceil$
- Replace $x$ by $\lfloor{\frac{x}{3}}\rfloor$
- Replace $x$ by $9x+2$
He starts with the number $0$. How many integers less than or equal to $7000$ can he achieve using the above functions?
[It is permitted to use a number greater than $7000$ in the way of achieving the desired numbers.]
My Approach
Call the functions $f_1,f_2,f_3$ respectively. $2$ is easily achievable from $0$ (using $f_3$). I've found that all the integers from $0$ to $10$ are achievable (Though we achieve them in a long way). The numbers get messy when we get ahead further. I can't prove that any number is unachievable. I've noticed that base-$3$ numbers can help for $f_2$ and $f_3$.
How to get ahead further?
Update: Mr. Mike showed that all integers are achievable by this process through codes. Mr. Calvin also gave a partial proof for that. So, a complete proof is needed currently.
Too long for a comment, but with the help of a computer, I found that all numbers in $\{1,\dots,7000\}$ are indeed reachable. I verified this with the following Python code, which uses a priority queue to find reachable numbers. The best priority ordering I found was to try the $\lfloor x/3\rfloor$ operation first, then to try the $\lceil x^2/2\rceil$ operation, and resorting to $9x+2$ last.
Try it online!
I found the the hardest number was $6121$. The path that led to it below. Here,
third x 7means you do this $\lfloor x/3\rfloor$ operation $7$ times.