Skip to content

A visualisation of the Collatz Conjecture, made using Python

Notifications You must be signed in to change notification settings

jyoo980/collatz-grapher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Collatz-Grapher: math and hailstones

The Collatz Conjecture is a famous unsolved problem in mathematics which asks if all natural numbers will eventually reach 1 if they are continually passed as arguments to a map f, defined as f(n) = n / 2 if n mod 2 = 0, or f(n) = 3n + 1 if n mod 2 = 1, for n > 0.

There is no complete formal proof of this conjecture, but it is widely believed to be true, even "large" numbers eventually reaching 1 after a series of steps. Unfortunately, my program does not prove the Collatz conjecture, but it does produce a very pretty graph, which you can see below:

collatz-graph

You can run Collatz-Grapher just by running some commands like I do below:

collatz-cmd

Here's what I want to do in the future, if you have any suggestions, feel free to make a PR!

  • Application of the collatz map to the input list is an example of an embarassingly parallel problem, I want to leverage parallelism to make this faster. [Complete]
  • I want to investigate what causes the bottleneck at around n ~ 1000000, whether it's due to the limitation of the graphing module, or whether it is due to something else.

In closing, here's a quote about the Collatz conjecture by the famous mathematician Paul Erdos:

"Mathematics may not be ready for such problems"

About

A visualisation of the Collatz Conjecture, made using Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages