cleverer Collatz sequnce generation with memoization.