collatzSequenceForN :: (Integral a) => a -> [a]
collatzSequenceForN n
| n == 1 = [1]
| even n = n : collatzSequenceForN (n `div` 2)
| odd n = n : collatzSequenceForN (n * 3 + 1)
collatzSequenceToN :: (Integral a) => a -> [[a]]
collatzSequenceToN n = map collatzSequenceForN [1..n]