Is it possible to describe the Collatz function in one formula?

$$f(n)=\frac74n+\frac12+(-1)^{n+1} \left(\frac54n+\frac12\right)$$


$$C(n)=\frac{n}{2}\cos^2\left(\frac{\pi n}{2}\right)+(3n+1) \sin^2\left(\frac{\pi n}{2}\right)$$

Continuous extension . M. Chamberland $(1996)$ observed that the entire function defined by $$f(x)=x+\frac{1}{4}-\frac{2x+1}{4} \cos (\pi x)$$ interpolates the $3n+1$ function: $$T(n)=\begin{cases} n/2 &\text{if } n \equiv 0 \pmod{2}\\ (3n+1)/2 & \text{if } n\equiv 1 \pmod{2} \end{cases}$$ and $T(n)=f(n)$ for $n\in \mathbb{N}$. This allows him to try to apply methods of one-dimensional discrete dynamical systems to $3n+1$ iterations.

Chamberland, M., A Continuous Extension of the 3x + 1 Problem to the Real Line, Dynamics of Continuous, Discrete and Impulsive Systems 2 A996), 495-509.


If you are searching for any way to write this in terms of elementary functions:

$$C(n)=n \cdot \left(\frac{1}{2}+\left\lfloor \frac{n}{2} \right\rfloor-\frac{n}{2}\right)+2(3n+1) \cdot \left(\frac{n}{2}-\left\lfloor \frac{n}{2} \right\rfloor\right)$$ where $\lfloor x \rfloor$ is the floor function (that is, the largest integer less than or equal to $x$).

But probably this is not the thing you were searching for...

Nonetheless, I'm quite sure that all possible such formulas involve a hidden "modulo condition" so it is probably the best way to write this in a more direct way as it's done usually...