Skip to content

Python script to visualize collatz conjecture stopping times in matplotlib

License

Notifications You must be signed in to change notification settings

Fingolfin7/Collatz-conjecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Collatz-conjecture

Python script to visualize collatz conjecture in matplotlib

What is the Collatz Conjecture?

From Wikipedia:

The Collatz conjecture is a conjecture in mathematics that concerns sequences defined as follows: start with any positive integer n. Then each term is obtained from the > previous term as follows: if the previous term is even, the next term is one half of the previous term. If the previous term is odd, the next term is 3 times the previous > term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.

The Program

Figure_1

The program asks the user to enter a list of seeds and plots the values in matplotlib. The console outputs the sequences for each seed as well as the largest value found in the sequence.

About

Python script to visualize collatz conjecture stopping times in matplotlib

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages