Crate beetle_collatz

source ·
Expand description

A collection of functions relating to the Collatz conjecture

Modules

Functions for finding numbers who take the most steps to reach 1, given the rules.
For checking to see if ranges of numbers fall to 1
Contains functions that apply the rules of the collatz conjecture until a number reaches one Functions herein with no return value are meant for benchmarking – and because return values aren’t strictly necessary. If needed there are also versions of each function that return a boolean value if they succeed.
Contains functions that apply the rules of the collatz conjecture in more performant ways
Functions for counting how many steps a number takes to reach 1
Functions for mapping integers to the number of steps they take to reach 1.

Functions

This has the effect of dividing a number by 2 until it is odd. Odd numbers are simply returned.
Same as divide_while_even, but also returns how many times the number was divided by 2 before becoming odd.