from math import sqrt for x in range(int(5 * sqrt(10)) + 1, int(5 * sqrt(20)) + 1): if not (500 % x): y = 500 // x - x print(2 * x * y * (x ** 4 - y ** 4))