Skip to content

Nefari0uss/collatz-conjecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collatz Conjecture - Hailstone Series Generator

Author: nefari0uss

language java Open Source Love Build Status

Summary

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.

Instructions

  • Use the given make file.
  • Alternatively, compile: $ javac CollatzConjecture.java
  • Run: $ java CollatzConjecture

Asciicast

asciicast

Releases

No releases published

Packages

No packages published