Calculate the length of the Collatz sequence for a given number
collatz(n) returns the length of the Collatz sequence for n.
collatz(n)
n