collatz chain with a few functions