Project Euler #14: Longest Collatz sequence