$\newcommand{\ulam}{\operatorname{ulam}}$
The ulam function is defined as $ \ulam(x) = \begin{cases} 1 & x = 1 \\ \ulam\left( \frac{x}{2}\right) & x \text{ even}\\ \ulam(3x+1) & x\text{ odd}\end{cases}$
I want to show that $\ulam$ is $\mu$-recursive by using primitive recursive functions and the $\mu$ opterator - not by e.g. defining a Turing machine.
This is a solution I got - but I don't understand it completely and it might above all be wrong.
$\begin{eqnarray*} f_p(x) & := & \begin{cases}\frac{x}{2} & x \text{ even} \\ 3x + 1 & x \text{ odd} \end{cases} \\ f_b(x) & := & \begin{cases}0 & x = 1 \\1 & x \neq 1\end{cases} \\ g(0,x) &=& x \\ g(n+1,x) &=& f_p(g(n,x)) \\ h(n,x) &=& f_b(g(n,x)) \\ \ulam(x) &=& g(\mu(h)(x),x) \end{eqnarray*}$
I do understand what the $\mu$ operator does in common, but there's still a gap in my mind between "find the smallest argument that returns zero" and a concrete application such "ulam".
Could you please check the solution and try to explain it to me?
Thanks in advance!