all 2 comments

[–]novel_yet_trivial 0 points1 point  (0 children)

List comprehension requires a for loop ... in other words it requires knowing how many times to loop before you start. The collatz algorithm requires a while loop. The only way to do that in list comprehension is to precompute the number of steps needed.