collatz
Mathematical Programming with Python
https://people.sc.fsu.edu/~jburkardt/classes/...
python_2025/collatz/collatz.html


collatz: the Collatz conjecture suggests that a simple operation, starting at any integer and repeated indefinitely, will always end at 1. It is interesting to determine how long it takes a particular starting point to reach 1. Also, from a given starting point, the sequence of iterates can sometimes increase very high before returning to earth. We can use a Python dictionary (a new datatype we don't actually know about yet) to update a table of our results. For some related sequences, the "Mollatz", "Nollatz" and "Pollatz" sequences, it is possible to say something definite about the convergence from any starting point.

Lecture notes:

A short article from Quanta:


Last revised on 13 January 2025.