Problem 14 / Challenge #14: Longest Collatz Sequence
The following iterative sequence is defined for the set of positive integers:
-
$n \to n/2$ ($n$ is even) -
$n \to 3n + 1$ ($n$ is odd)
Using the rule above and starting with
It can be seen that this sequence (starting at
Which starting number, under one million, produces the longest chain?
NOTE: Once the chain starts the terms are allowed to go above one million.
ProjectEuler+ Problem Statement
The Project Euler problem is equivalent to the ProjectEuler+ challenge with