An implementation of the infamous Collatz Conjecture, which is also known as Hailstone's Sequence, written in Python 3.
- Python 3:
- math
- time
- tabulate
- matplotlib.pyplot
The Collatz conjecture is a conjecture in mathematics that proposes that given any nonnegative odd interger greater than or equal 1, the elements [4, 2, 1]
will be infinitely repeated by the sequence created by replicating the following algorithm:
- Start with any nonnegative odd interger greater than or equal 1 as the first term.
- If the previous term is even, the next term is one half the previous term.
- If the previous term is odd, the next term is 3 times the previous term plus 1.
- Repeat Steps 1-3 with the created term
To learn more about the Collatz conjecture, visit the Wikipedia Article attributed to it.