Base conversion puzzle
Define $f(s)=h(g(s))$, where $g(\cdot)$ is the conversion to octal and then interpreting the result as a decimal string, and $h(\cdot)$ is the conversion to hexidecimal and then interpreting the result as a decimal string (if possible).  For instance, $g(245)=365$, and $h(365)=163$.

Asymptotically, it is easy to see that $g(x) \sim x^\alpha$, where $\alpha = \log_8 10 = 1.1073\dots$.  In other words, once $x$ is large enough, $g(x)$ is asymptotically proportional to $x^{\alpha}$.  (Why?   Consider $x=8^k$, or $x=a \cdot 8^k$ where $a \in \{1,2,\dots,7\}$.  Once $x$ is large enough, the lower-order terms in the base-8 representation of $x$ become negligible, asymptotically.)  Similarly, asymptotically we have $h(y) \sim y^\beta$, where $\beta = \log_{16} 10 = 0.83048\dots$.

It follows that asymptotically

$$f(s) \sim s^{\alpha \beta}.$$

Notice that $\alpha \beta = 0.9196\dots$, and in particular $\alpha \beta &lt; 1$.  Therefore, asymptotically, $f(s)$ grows more slowly than $s$.

It follows that there is a constant $c$ such that, for all $s&gt;c$, we have $f(s)&lt;s$.  From this it is easy to see that we only need to check finitely many  possible values of $s$: the values $s=1,2,\dots,c$.

All that remains is to determine the constant $c$ explicitly.  This can be done with a bit of algebra; it gets a bit messy, and I don't know of any elegant way to derive it.  But hopefully the above is a relatively clean way to show why your approach has to work, and isolates the messy part to a well-contained calculation.  To me, this is much nicer, because it provides some pretty simple intuition about why there can be only finitely many fixed points.

In other words, this all follows as a consequence of the fact that

$$(\log_8 10) \times (\log_{16} 10) &lt; 1.$$