If $a$, $b$ and $n$ are positive integers such that $\frac{1}{a} + \frac{1}{b} = \frac{1}{n}$ then what is the total number of pair of $(a,b)$? 
If $a$, $b$ and $n$ are positive integers such that $\frac{1}{a} + \frac{1}{b} = \frac{1}{n}$ then what is the total number of pair of $(a,b)$? What if $a$, $b$ and $n$ are not necessarily positive integers?

My attempt:- If $n$ is small, like 
$$\frac{1}{a} + \frac{1}{b} = \frac{1}{5}$$
I just convert it to a suitable form like this
$$5a + 5b = ab$$
After this, I just try by hit and trial.  
But I need a suitable method to solve these type of questions. I always get stuck on these for a long time.
 A: The way you reduced it, is pretty much all you could do with problems like these. In general, we get $an+bn=ab$, so we get $ab+n^{2}-an-bn=n^{2}$, that is $(n-a)(n-b)=n^{2}$, now you could check all the factors of $n^{2}$ and manually try to find all $a,b$ that work.
A: If you solve further, you see that:
$$b = \dfrac{na}{a-n}$$
Note that the fraction on the RHS, is only positive for $a>n$. It only suffices to find all integers $a$ such that $a-n|an$. This is trivial , by setting $a = (k+1)n$, where $k$ is any factor of $n$.This will give you the solution set.
A: The answer is infinitely many pairs.
Let $a = b$. Then,
$$\frac{1}{a} + \frac{1}{b} = \frac{1}{a} + \frac{1}{a} = \frac{2}{a}$$
From which we get $n = \frac{a}{2}$. This gives $a = b = 2n$ as sufficient to fulfill the equation. Since the last equation is itself fulfilled by infinitely many different values of $a$, it follows that there are infinitely many pairs of $(a,b)$, even if $a$, $b$ and $n$ are not necessarily positive, and we haven't even looked at the cases where $a \neq b$.
As for your other question, I can't really help as I came across this by chance. I haven't taken a course on this topic so it just looks like trickery to me.
