Skip to content

Takes a number, runs it through the collatz conjecture, shows you the steps

License

Notifications You must be signed in to change notification settings

alegerosa/collatz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

The Collazt Conjecture on Python

Simple script that runs a number through the Collatz Conjecture and prints the steps

When you input a number, the program applies the Collatz Conjecture rules:

  • If the number is even, divide it by two;
  • if it's odd multiply by three and add one;
  • repeat until you reach one.

The program prints all steps and finally prints how many steps it took to get to 1.

Originally written in 2016, it was inspired by this Someecards post.

This was my first program and also my first Python script that I wrote myself (i.e. not homework), so it's only fitting that it also becomes my first GitHub repository ❤️

About

Takes a number, runs it through the collatz conjecture, shows you the steps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages