[Math] Number of pairs of coprime positive integers $(a, b)$ such that $\frac{a}{b} + \frac{14b}{a}$ is an integer

contest-mathcoprimeelementary-number-theoryfractionsnumber theory

How many pairs of positive integers $(a, b)$ are there such that $a$ and $b$ have no common factor greater than $1$ and $\frac{a}{b} + \frac{14b}{a}$ is an integer?

The problem I'm facing in this question is that is there any algebraic or short-cut method to find the pairs. Else I've done it by Hit and Trial but that consumes a lot of time.

Best Answer

You are looking for coprime integers $a$ and $b$ for which $$\frac{a}{b}+14\frac{b}{a}=\frac{a^2+14b^2}{ab},$$ is an integer. Then $b$ divides $a^2$, and so $b=1$ because $\gcd(a,b)=1$. Now the above reduces to $$\frac{a^2+14}{a},$$ which is an integer if and only if $a$ divides $14$, i.e. $a\in\{1,2,7,14\}$.