Tribute to John Conway: Collatz in FRACTRAN
9 8 7 fractions

$$\frac{5}{4}, \frac{63}{22}, \frac{14}{55}, \frac{66}{35}, \frac{1}{7}, \frac{2}{3}, \frac{44}{5}$$

Takes input as \$3^n\$.

Try it online!

How it works

The first transition is

$$3^n \xrightarrow{\frac{2}{3}} 2 \cdot 3^{n - 1},$$

which we will consider the “real” representation of the number \$n\$, because some intermediate control flows will bypass the above transition.

If \$n = 1\$, the program now halts immediately.

If \$n = 2k\$ is even, we have

$$\begin{multline*}
2 \cdot 3^{2k - 1}
\xrightarrow{\frac{2}{3}}
2^2 \cdot 3^{2k - 2}
\xrightarrow{\frac{5}{4}}
3^{2k - 2} \cdot 5
\xrightarrow{\left(\frac{2}{3} \cdot \frac{2}{3} \cdot \frac{5}{4}\right)^{k - 1}}
5^k
\xrightarrow{\frac{44}{5}}
2^2 \cdot 5^{k - 1} \cdot 11
\\
\xrightarrow{\frac{5}{4}}
5^k \cdot 11
\xrightarrow{\frac{14}{55}}
2 \cdot 5^{k - 1} \cdot 7
\xrightarrow{\left(\frac{66}{35} \cdot \frac{5}{4} \cdot \frac{14}{55}\right)^{k - 1}}
2 \cdot 3^{k - 1} \cdot 7
\xrightarrow{\frac{1}{7}}
2 \cdot 3^{k - 1},
\end{multline*}$$

which represents \$\frac{n}{2}\$.

If \$n = 2k + 1\$ is odd, we instead have

$$\begin{multline*}
2 \cdot 3^{2k}
\xrightarrow{\left(\frac{2}{3} \cdot \frac{5}{4} \cdot \frac{2}{3}\right)^k}
2 \cdot 5^k
\xrightarrow{\frac{44}{5}}
2^3 \cdot 5^{k - 1} \cdot 11
\xrightarrow{\frac{5}{4}}
2 \cdot 5^k \cdot 11
\\
\xrightarrow{\frac{63}{22}}
3^2 \cdot 5^k \cdot 7
\xrightarrow{\left(\frac{66}{35} \cdot \frac{63}{22}\right)^k}
3^{3k + 2} \cdot 7
\xrightarrow{\frac{1}{7}}
3^{3k + 2}
\xrightarrow{\frac{2}{3}}
2 \cdot 3^{3k + 1},
\end{multline*}$$

which represents \$3k + 2 = \frac{3n + 1}{2}\$, which is two steps ahead of \$n\$.