Last active
August 8, 2021 13:08
-
-
Save xto3na/0388f992f3a9a58d6812d0827817e6c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function threePlusOne(number) { | |
console.info(number); | |
if(number === 1 || number === 0) { | |
return number; | |
} else { | |
if(number%2) { | |
threePlusOne(number * 3 + 1); | |
} else { | |
threePlusOne(number / 2); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Collatz Conjecture is the simplest math problem no one can solve — it is easy enough for almost anyone to understand but notoriously difficult to solve.