Solve Longest chain
Refactor collatz, add caching