You are trying to compute the length of the Collatz chain, aren't you. Do you realise that currently you always return 1? You should modify your code to return the count instead. That means adding the current iteration to the recursive call: