Skip to content

Instantly share code, notes, and snippets.

@shakayami
Created September 6, 2021 10:55
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 shakayami/88f0e286049c3efc5cef06158c6ee470 to your computer and use it in GitHub Desktop.
Save shakayami/88f0e286049c3efc5cef06158c6ee470 to your computer and use it in GitHub Desktop.
mex=1
while(True):
print(mex)
X=mex
S={X}
while(X>1):
if X%2==0:
X//=2
else:
X=3*X+1
if X<mex:
break
elif X in S:
print("hanrei",X)
assert False
else:
S.add(X)
mex+=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment