News for hackers. Stuff that matters.
Re:Almost all Collatz orbits attain almost bounded values by paulddraper on Wednesday September 11, 2019 @07:50PM (#20946012)
It's a particularly good example of memoization: both simple and without a suitable DP solution.

   int collatz(int n) {
     return n == 1 ? 0 : 1 + collatz(n % 2 ? 3 * n + 1 : n / 2)
   }

There are no comments on this comment yet.