Positive integers a,b are such that 137 divides a+139b and 139 divides a+137b. Find the minimum possible value of a+b.
The minimum value for the sum a+b is 343
(275 + 139*68) / 137 = 71.0
(275 + 137*68) / 139 = 69.0
-----------------
found = False
for asum in range(2,1000):
if found:
break
for a in range(1,asum):
b = asum - a
if (a + 139*b)%137 != 0:
continue
if (a + 137*b)%139 != 0:
continue
found = True
if found:
break
print('The minimum value for the sum a+b is {}'.format(a+b))
print('({} + 139*{}) / 137 = {}'.format(a,b, (a+139*b)/137))
print('({} + 137*{}) / 139 = {}'.format(a,b, (a+137*b)/139))
|
Posted by Larry
on 2023-12-07 16:36:52 |