Skip to content

Instantly share code, notes, and snippets.

@darkcris1
Created January 5, 2021 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkcris1/d5017c0d1a9fe416b0770eb9c8076fdd to your computer and use it in GitHub Desktop.
Save darkcris1/d5017c0d1a9fe416b0770eb9c8076fdd to your computer and use it in GitHub Desktop.
Sololearn cConjecture Community Challenge
function cConjecture(x) {
const result = []
while (x > 1) {
if (x % 2 === 0) {
x = x / 2
result.push(x)
} else {
x = x * 3 + 1
result.push(x)
}
}
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment