Skip to content

A program in python to visualize the cycle length and values for the collatz conjecture. It can also be used for collatz_like sequences aswell as negative numbers.

License

Notifications You must be signed in to change notification settings

ln2058/collatz-cycle-visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

collatz-cycle-visualization

Uses numpy and matplotlib for visualization of collatz cycle

The aim of this project is to enable visualizations of any cycle similar to collatz to maybe establish a new perspective on the original collatz sequence.

Input: rules for_even_ & odd and minimum & lower bound.
*( make sure that the sequence does not go to infinity )

Example graphs for difference rules

Rule1: Original 3n+1

Rule 2: 3n+1 extended to negative numbers

Rule 3: Even: 3n+1, odd: (0.5*n)+0.5

Rule 4: Even: 2n+1, odd: (0.5*n)+0.5

Rule 5: Even: -n/2 odd: -3*n+1

Rule 5: Even: n/2 odd: -3*n+1

Further improvements to make

  • Add a method for detecting if an sequence goes to infinity so that the program can stop
  • Extending the program to more domains and operations - For example: rational, complex numbers and using more than 2 mod statements
  • Extend program to negative numbers
  • Make an algorithm to find many collatz like sequences

About

A program in python to visualize the cycle length and values for the collatz conjecture. It can also be used for collatz_like sequences aswell as negative numbers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages