memoize longest collatz sequence