Back to General discussions forum
24 Neumans Generator
n = int(input()) datas = input().split()
def sqr(a): a = a * a return a
for data in datas: i = 0 while int(data) != 4100: data = str(sqr(int(data))) while len(data) <= 7: data = '0' + data data = data[2:6] i += 1 print(i + 4, end=' ')
Please help I dont know why result right in 50% cases
Integer overflow. Max ineger value = 2 147 483 647. So you can't stor numbers greter then integer max value