collatz 0.3.1

Helper functions related to the Collatz conjecture
Documentation

collatz

Helper functions related to the Collatz conjecture (also know as the 3n + 1 problem or the 3n + 1 conjecture).

Problem

Given a positive integer N do the following steps repeatedly:

  • If the number is even, divide it by two.
  • If the number is odd, triple it and add one. The Collatz conjecture states that for every positive integer you will reach one in a finite number of steps.

Examples

  • Performance comparison: single threaded vs using rayon
  • Plotting collatz steps in the console for a specified number