Skip to content

Start with a number n > 1. Find the number of steps it takes to reach one using the following process: If n is even, divide it by 2. If n is odd, multiply it by 3 and add 1.

License

Notifications You must be signed in to change notification settings

codeslacker1155/Collatz-Conjecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Collatz-Conjecture

Start with a number n > 1. Find the number of steps it takes to reach one using the following process: If n is even, divide it by 2. If n is odd, multiply it by 3 and add 1.

Description

Start with a number n > 1. Find the number of steps it takes to reach one using the following process: If n is even, divide it by 2. If n is odd, multiply it by 3 and add 1. The program is a static command line program that shows the user how this classical alghorithm works.

Getting Started

Dependencies

  • NO DEPENDENCIES REQUIRED!!!

Installing

  • No real install needed, just make sure you have the bash terminal updated
sudo apt update
sudo apt upgrade
sudo apt-get install node

Executing program

  • Run the program like any other common bash script.
node cconjecture.js

Help

Common problems or issues are that you are not using an authorized user and need to switch to root.

sudo node cconjecture.js

Authors

Contributors names and contact info

Christopher Hyatt (me)

Version History

License

This project is licensed under the [GNU Privacy v3] License - see the LICENSE.md file for details

Acknowledgments

Inspiration taken from a list of basic programs to make in any language that I have in a random text file of ideas.

About

Start with a number n > 1. Find the number of steps it takes to reach one using the following process: If n is even, divide it by 2. If n is odd, multiply it by 3 and add 1.

Topics

Resources

License

Stars

Watchers

Forks