Kaweees / Collatz.py

An implementation of the infamous Collatz Conjecture, which is also known as Hailstone's Sequence, written in Python 3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers

Collatz.py

An implementation of the infamous Collatz Conjecture, which is also known as Hailstone's Sequence, written in Python 3.

Built With

  • Python 3:
    • math
    • time
    • tabulate
    • matplotlib.pyplot

Collatz conjecture

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:

  1. Start with any nonnegative odd interger greater than or equal 1 as the first term.
  2. If the previous term is even, the next term is one half the previous term.
  3. If the previous term is odd, the next term is 3 times the previous term plus 1.
  4. Repeat Steps 1-3 with the created term

To learn more about the Collatz conjecture, visit the Wikipedia Article attributed to it.

About

An implementation of the infamous Collatz Conjecture, which is also known as Hailstone's Sequence, written in Python 3.


Languages

Language:Python 100.0%