I am trying some stuff on the 3x+1 problem and noticed when I check if this num is divisible by two comes always true even that the second iteration should be false it goes like this for 20 iterations and then start to act right. I guess it is a long number issue?
num = 3656565605161651626526625291991265161656
while num != 1:
if (num % 2 == 0):
num /= 2
print("2")
else:
num *= 3
num += 1
print("3")
num2=f'{num:.1f}'
print(num2)
Here is the start of the result:
2
1828282802580825918440824287108404346880
2
914141401290412959220412143554202173440
2
457070700645206479610206071777101086720
2