Author: nefari0uss
This program will do the Collatz Conjecture. It takes a integer input and finds the number of steps to reach one using the following algorithm:
- If n is even, divide it by 2.
- If n is odd, multiply it by 3 and add 1.
The Collatz Conjecture
is also known as the 3n + 1 conjecture
and the numbers of the sequence are refered to as hailstone numbers.
More information can be found on Wikipedia.
- Use the given make file.
- Alternatively, compile:
$ javac CollatzConjecture.java
- Run:
$ java CollatzConjecture