Skip to content

Instantly share code, notes, and snippets.

@dmishin
Created May 19, 2024 19:57
Show Gist options
  • Save dmishin/c1d5437e3b08ab44944440589f5d20e2 to your computer and use it in GitHub Desktop.
Save dmishin/c1d5437e3b08ab44944440589f5d20e2 to your computer and use it in GitHub Desktop.
s="324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273324873427892347892347893279832473428793298893482287234724377243774327273432433"
import sys
sys.set_int_max_str_digits(len(s)+1)
n = int(s)
def check(n):
while n != 1:
if n & 1 == 0:
n >>= 1
else:
n = 3*n + 1
return True
#measure time to check
import time
start = time.time()
check(n)
end = time.time()
print(f"Verified in: {end-start}s")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment