32 lines
505 B
Python
32 lines
505 B
Python
def test_ori(a, b):
|
|
tmp = a ** 2 + b ** 2
|
|
sqr = int(tmp ** 0.5)
|
|
if tmp == sqr ** 2: return True
|
|
return False
|
|
|
|
def test(a, b, c):
|
|
if test_ori(b + c, a): return 1
|
|
return 0
|
|
|
|
def test1(a, b):
|
|
if test_ori(b + b, a): return 1
|
|
return 0
|
|
|
|
total = 1975
|
|
n = 100
|
|
while 1:
|
|
tmp = 0
|
|
for i in xrange(2, 2 * n + 1):
|
|
if test_ori(n, i):
|
|
#print i
|
|
tmp += i / 2
|
|
if i > n:
|
|
tmp -= i - n - 1
|
|
total += tmp
|
|
if total > 1000000:
|
|
break
|
|
#print n, tmp, total
|
|
n += 1
|
|
|
|
print n
|