solve collatz sequence