Last active
September 3, 2017 08:28
-
-
Save hisui/7c2e04dd946dafd572d2ab0e184b24cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from itertools import * | |
for e in takewhile(lambda e: e != 1, accumulate(chain([7], count()), lambda n, _: n // 2 if (n % 2) == 0 else n * 3 + 1)): | |
print(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment