Definition:Collatz Sequence

Definition
Let $f: \N \to \N$ be the mapping defined on the natural numbers as follows:


 * $\forall n \in \N: \map f n = \begin{cases}

n / 2 & : n \text { even} \\ 3 n + 1 & : n \text { odd} \end{cases}$

For any given value of $n$, let the sequence $\sequence {S_k}$ be defined:


 * $\forall k \in \N: S_k = \begin {cases}

n & : k = 0 \\ \map f {S_{k - 1} } & : k > 0 \end {cases}$

Then $\sequence {S_k}$ is known as a Collatz sequence.