This script was created with the intent of visualizing what the progression of numbers looks like under the Collatz Conjecture.
I took inspiration on the following video for this project: The Simplest Math Problem No One Can Solve - Collatz Conjecture
PS: This project is not a "solution for the unsolvable problem". It is simply a visualizer.
pip install -r requirements.txt
Create a file called .env and insert the following contents
PLT_GRAPH=1 #Creates MatplotLib window
OUT_CONSOLE=0 #Outputs result on console
OUT_JSON=0 #Outputs result on json
If config file is not created, the script will automatically create it for you.
python main.py <value:Integer>
python main.py 3
Number must be positive (Above 0)
If number is even, it will be divided by 2
If number is odd, it will be multiplied by 3 and have a 1 added to it, which will make it even.
| Number Type | Method |
|---|---|
| Even | ÷2 |
| Odd | 3x+1 |
This will happen in a cycle until the formula reaches the following final numbers: 4,2,1
Youtube: The Simplest Math Problem No One Can Solve - Collatz Conjecture
Wikipedia: Collatz conjecture