Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Famous math problems
var collatz = function(n) {
var result;
console.log(n);
result = n % 2 == 0 ? n/2 : 3 * (n + 1);
return collatz(result);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment