Is it possible to describe the Collatz function in one formula? This is related to Collatz sequence, which is that
$$C(n) = \begin{cases} n/2 &\text{if } n \equiv 0 \pmod{2}\\ 3n+1 & \text{if } n\equiv 1 \pmod{2} .\end{cases}$$
Is it possible to describe the Collatz function in one formula? (without modular conditions)

You can use floor/ceiling maps. If you let $f(n) = 2*(n/2 - floor (n/2 ))$ then this function is the indicator of whether $n$ is odd or even, (i.e. $f(n) = 1$ if $n$ is odd and $f(n) = 0$ if $n$ is even), and so then you can define $C(n) = f(n)*(3n + 1) + (1 - f(n))*(n/2)$.
However, note that looking at the floor of $n/2$ and using this in your formula by comparing to $n/2$ is basically the same as having different "cases" for the value of the function depending on whether $n$ is odd or even. I don't think there's any better way around it though, if you want one formula.
