Skip to content

Instantly share code, notes, and snippets.

@ruan65
Created September 26, 2016 21:32
Show Gist options
  • Save ruan65/17bb8b1c1e94486eeeb40f7700c464dc to your computer and use it in GitHub Desktop.
Save ruan65/17bb8b1c1e94486eeeb40f7700c464dc to your computer and use it in GitHub Desktop.
#!/usr/bin/python
n = 11
while n != 1:
print n
if n % 2 == 0:
n /= 2
else:
n = 3 * n + 1
print n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment