Collatz Function – Is It Possible to Describe in One Formula?

collatz conjectureelementary-number-theoryfunctions

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)

Best Answer

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

Related Question