Prove an arithmetic property of a partial recursive function
The function $f$ computes the recurrence relation
$$
f(x) = \begin{cases}
4 &amp; x \leq 1, \\
f(x-1)^2 f(x-2)^4 &amp; x &gt; 1.
\end{cases}
$$
Taking $\ell = \log_2 \circ f$, we get
$$
\ell(x) = \begin{cases}
2 &amp; x \leq 1, \\
2\ell(x-1) + 4\ell(x-2) &amp; x &gt; 1.
\end{cases}
$$
Now, modulo 10 we have
$$
2 \cdot 2 + 4 \cdot 2 = 12 \equiv 2 \pmod{10}.
$$
An easy proof by induction then shows that $\ell(x) \equiv 2 \pmod{10}$ for all $x$.