This Python script generates an animated 3D visualization of the Collatz Conjecture using matplotlib. The Collatz Conjecture is a famous unsolved mathematical problem also known as the "3x+1 problem".
The Collatz Conjecture, named after the German mathematician Lothar Collatz, is a sequence defined as follows:
- Start with any positive integer ( n ).
- If ( n ) is even, divide it by 2 to get ( n/2 ).
- If ( n ) is odd, multiply it by 3 and add 1 to get ( 3n + 1 ).
- Repeat the process indefinitely.
The conjecture posits that no matter which positive integer you start with, the sequence will always eventually reach the number 1. Despite extensive computational evidence supporting this conjecture, a formal proof remains elusive, making it one of the many intriguing unsolved problems in mathematics.
- Python 3.x
- matplotlib
Clone the repository:
bash
git clone https://github.com/AtlasCJr/Collatz-Conjecture
cd Collatz-ConjectureInstall dependencies:
pip install matplotlibRun the script to generate the animated GIF:
Collatz Conjecture.py
The animation will be saved as Animation_Collatz_Conjecture.gif in the Animations directory.
The script initializes a set of points and iteratively applies rotations and scaling based on specific rules related to the Collatz Conjecture:
- Points are represented in 3D space.
- Each point is updated and rotated based on its current state and position.
- The animation evolves over 180 frames, with each frame updated every 50 millisecond
