Skip to content

Instantly share code, notes, and snippets.

@lnds
Created May 5, 2012 14:05
Show Gist options
  • Select an option

  • Save lnds/2602718 to your computer and use it in GitHub Desktop.

Select an option

Save lnds/2602718 to your computer and use it in GitHub Desktop.
Mejorando la solución al problema siracusa, segundo intento
INT orbita(INT n) {
INT largo = 0;
do {
if (n&0x01)
n = ((n<<1)|1)+n;
do {
n = n>>1;
largo++;
} while(!(n&0x01));
} while (n>1);
return largo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment