/collatz-conjecture

A simple Python script to test the Collatz Conjecture

Primary LanguagePython

Collatz Conjecture

The Collatz Conjecture is a mathematical hypothesis pertaining to sequences, defined as follows: Start with any positive integer n. If n is even, divide it by 2; if n is odd, multiply it by 3 and add 1. Repeat this process with the resulting number. The conjecture states that no matter which positive integer you start with, the sequence will always eventually reach the number 1. Despite its simple formulation, the Collatz conjecture remains unproven and is waiting to be solved.

In this repository, you will find a simple python script to test numbers yourself. The script is very easy to use, simply type your number and press enter and the result will print out and immediately prompt you for another integer. If you want to exit, simply press q and hit enter.

Comic by xkcd referencing the Collatz Conjecture

Comic by xkcd