f(n)={n2, if n is even 3n+1, if n is odd f(n) = \begin{cases} \frac{n}{2}, & \text{if n is even} \\[20ex] 3n+1, & \text{if n is odd} \end{cases}