# Number of pairs of co-prime positive integers $(a, b)$ such that $\frac{a}{b} + \frac{14b}{a}$ is an integer?

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.

• Another way to say this is: $$\frac{a^2+14b^2}{ab} \text{ is an integer}$$ I'm not sure if this helps, though. – Noble Mushtak Jun 26 '16 at 19:42

## 2 Answers

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\}$.

• Why $b$ divides $a^2$? – Qwerty Jun 26 '16 at 19:49
• Because $b$ divides $a^2+14b^2$, because the shown fraction is an integer. – Inactive - Objecting Extremism Jun 26 '16 at 19:49
• Why not $a$ divides $b^2$? – Qwerty Jun 26 '16 at 19:51
• @Qwerty: you also have $a$ divides $14b^2$, but factors can come from $14$ as well. – Ross Millikan Jun 26 '16 at 19:53
• The problem restricts $a,b$ to positive integers, so the $\pm$ are not necessary here. – Théophile Jun 26 '16 at 20:05

Let $\, x = a/b.\,$ $\,x+14/x = n\,$ so $\, x^2\!-nx+14 = 0\,$ so $\ b\mid1,\,a\mid 14\,$ via Rational Root Test.

• I don't know what's Rational Root Test .. Can you explain it to me !! – Amritanshu Jun 26 '16 at 20:00
• @Amritanshu I added a link. – Bill Dubuque Jun 26 '16 at 20:01
• Perfect!! Worth including in "PROOFS FROM THE BOOK". ..:-) – Qwerty Jun 26 '16 at 20:06
• Very elegant :) +1 – Inactive - Objecting Extremism Jun 26 '16 at 20:08