use-collatz
Install
[]
= "0.0.6"
Foundation
use-collatz provides a deliberately small surface for computing with the Collatz map on positive u64 inputs:
- if
nis even, the next value isn / 2 - if
nis odd, the next value is3n + 1
The Collatz conjecture remains unproven. This crate does not claim to prove it or to settle its global behavior. Instead, it focuses on bounded computational exploration: generating trajectories, measuring stopping behavior, inspecting parity patterns, and summarizing finite inclusive ranges.
When to use directly
Choose use-collatz directly when Collatz trajectory analysis is the only math support you need and you want to keep that concern narrow and dependency-free.
| Scenario | Use use-collatz directly? |
Why |
|---|---|---|
| You need the explicit trajectory for one starting value | Yes | The crate keeps the sequence utilities small and concrete |
| You need stopping times or peak values for bounded inputs | Yes | The API centers on direct trajectory metrics without extra abstractions |
| You want parity patterns for exploratory experiments | Yes | The parity helpers stay aligned with the trajectory surface |
| You need broader numeric, algebraic, or symbolic abstractions | Usually no | Those belong in adjacent focused crates or the use-math facade |
Scope
- The current surface is intentionally small and concrete.
- All public helpers operate on positive
u64inputs. - Odd steps use checked arithmetic so overflow returns
Noneinstead of wrapping. - The crate is for bounded computational exploration, not proof, exhaustive classification, or conjecture claims.
Examples
Generate a full trajectory
use ;
assert_eq!;
assert_eq!;
Inspect parity and range summaries
use ;
assert_eq!;
let summary = verify_range;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Status
use-collatz is a concrete pre-1.0 crate in the RustUse math workspace. The API remains intentionally small while adjacent sequence and number-theory crates continue to grow around it.