Determine the total number of pairs of positive integers (a,b) that satisfy both the following conditions:
(I) GCD(a, b)=1
(II) a/b + 14b/9a is an integer.
I found 4 solutions by hand, and showed that there are no other solutions.
a/b + 14b/9a = N
9a^2 + 14b^2 = 9abN
let c = a/b
9c^2 + 14 = 9Nc
9c^2  9Nc + 14 = 0
c = a/b = [9N ± √(81N^2  504)]/18
c = [3N ± √(9N^2  56)]/6
9N^2  56 must be a square
N:2, 3, 4, 5
20, 25, 88, 169 we have 5^2 and 13^2
N=3: a/b = (9 ± 5)/6 = 14/6 or 2/3
(a,b) = (7,3), (2,3)
... each of which evaluates to 3.
try N=5: a/b = (15 ± 13)/6 = 28/6 or 2/6
(a,b) = (14,3), (1,3)
... each of which evaluates to 5
Solution set: {(1,3), (2,3), (7,3), (14,3)}
Proof that there are no other solutions.
(9N^2  56) must be a square.
9N^2 is (3N)^2. So the next smaller square cannot be more than 56 units smaller.
(x1)^2 is (2x1) smaller than x^2
So if (6N1) is larger than 56, (9N^2  56) clearly cannot be a square.
So N cannot be larger than 9.
Check a few more N's
9N^2  56
N:2, 3, 4, 5, 6, 7, 8, 9
20, 25, 88, 169, 268, 385, 520, 673
qed

program verification:
def f(a,b):
return a/b + 14*b / (9*a)
for a in range(1,10000):
for b in range(1,10000):
if gcd(a,b) != 1:
continue
if f(a,b) % 1 != 0:
continue
x = f(a,b)
print('({},{}), expression evaluates to {}'.format(a,b,x))
Program Output:
(1,3), expression evaluates to 5.0
(2,3), expression evaluates to 3.0
(7,3), expression evaluates to 3.0
(14,3), expression evaluates to 5.0

Posted by Larry
on 20240125 14:19:49 