Expand description
Collatz conjecture: sequences, stopping times, and tree visualization.
Structs§
- Collatz
Glyph - Collatz
Tree - The full reverse Collatz tree: starting from 1, build upward. Each node n has child 2n (always), and child (n-1)/3 if n ≡ 1 mod 3 and (n-1)/3 is odd and > 0.
- Collatz
Tree Renderer - Layout and render the Collatz tree with branch colors based on path length.
- Tree
Node - A node in the reverse Collatz tree.
Functions§
- collatz_
sequence - Compute the Collatz sequence starting from n until it reaches 1.
- collatz_
stopping_ time - Number of steps for n to reach 1.