This application allows you to graphically visualize the sequences of the Collatz Conjecture (also known as the Syracuse Conjecture) for one or two given integers.
The Collatz Conjecture is defined by the following rule:
- If n is even, the next term is n/2
- If n is odd, the next term is 3n+1
The sequence stops when the value 1 is reached.
Window
Saved chart
- Graphical visualization of sequences for one or two integers
- Detailed statistics display:
- Flight time (number of steps)
- Maximum altitude (highest value reached)
- Count of even/odd values
- Downtime
- Random value generation
- Save the graph image
- Copy sequences to the clipboard
- Rust and Cargo (https://www.rust-lang.org/tools/install)
- Extract the zip archive
- Open a terminal in the extracted folder
- Run the following command to compile and launch the application:
cargo run
To create an optimized version:
cargo build --release
The executable will be located in the target/release/
folder.
- Enter one or two integers in the input fields
- Click "Visualize" to display the graph
- Use "Randomize" to generate random values
- Use "Save" to save the graph image
- Use "Copy" to copy the sequences to the clipboard
src/main.rs
: User interface and main application logicsrc/collatz.rs
: Implementation of the Collatz Conjecture algorithm
- iced: Graphical user interface
- plotters: Graph visualization
- rand: Random number generation
- clipboard: Clipboard access
- chrono: Date and time management
- image: Image manipulation
This project is distributed under the MIT license.