The Syracuse (Collatz or Hailstone) conjecture concerns a sequence of integers defined as follows:
Starts with any positive integer N
And each term is formed from the previous one as follows:
if the previous term is odd:
the next term is 3 times the previous term and plus 1
if the previous term is even:
the next term is half the previous term
The sequence will always reach 1. 🏁
-
Solution in IPython Notebook 8.5.0: Syracuse.ipynb
-
Solution in Python 3.10.6: Syracuse.py
Seaborn
pip install seaborn
Matplotlib
pip install matplotlib
Plotext
pip install plotext
$ git clone https://github.com/skuantaiuly/Syracuse.git
Kuantaiuly Salamat
11/2022, developed on IPython and Jupyter Notebook, Visual Studio Code