Optimized version of a code that calculates the maximum cycle length (Collatz sequence) of a range of numbers from 1 up to 4.000.000.000.