# How many ordered pairs of positive integers

For a prime integer p, how many ordered pairs of positive integers (a, b) are there that satisfy $$\frac{1}{a} + \frac{1}{b} =\frac{1}{p}$$

For example, for p = 5, $$\frac{1}{6} + \frac{1}{30}$$ and $$\frac{1}{30} + \frac{1}{6}$$ are two different ways of getting $\frac{1}{5}$.

Ok, so I tried this for prime numbers from 2 to 19. It seems like that for any prime number there are only 3 such ordered pairs.

(Question: $\frac{1}{10} + \frac{1}{10}$ is just one ordered pair for p=5, right?)

But I don't know how to go about proving this. I can see that:

After $\frac{1}{p}$, take the next smallest fraction of the form $\frac{1}{a}$. Now we always get a fraction $\frac{1}{a} + \frac{1}{b}$. Also, now b is the upper bound for the numbers we need to check. But there is always just one other integer between a and b which satisfies for this property, this integer is is 2p

The question does not specifically ask for a prove, but they always expect a prove for everything.

If we multiply through by $pab$, we find that for $a, b \ne 0$, our equation is equivalent to $pb+pa=ab$, which we can rewrite as $$(a-p)(b-p)=p^2.$$ We are looking for non-zero solutions of this equation. Conveniently, $p^2$ does not have many factorizations!

We can have $a-p=-1$, $b-p=-p^2$, which yields a negative $b$, or $a-p=-p^2$, $b-p=-1$, which yields a negative $a$.

We could have $a-p=-p$, $b-p=-p$, but that yields the impossible $a=b=0$.

We can have $a-p=1$, $b-p=p^2$, or $a-p=p^2$, $b-p=1$, which respectively yield the solutions $a=p+1$, $b=p^2+p$, and $a=p^2+p$, $b=p+1$.

Finally, we can have $a-p=p$, $b-p=p$, which yields $a=b=2p$.

Comment: The same idea can be used to find all integer solutions of the equation $\frac{1}{x}+\frac{1}{y}=\frac{1}{n}$, where $n$ is a given positive integer. The factorizations of $n^2$, with the exception of $n^2=(-n)(-n)$, supply the integer solutions.

$1/a+1/b=1/p$, $bp+ap=ab$, $(a+b)p=ab$, so $p$ divides $a$ or $p$ divides $b$ (or both). Let's say $p$ divides $a$, so $a=cp$ for some $c$. Now $cp+b=bc$, $b=bc-pc=(b-p)c$, so $c$ divides $b$. Let $b=cd$. Then $d=cd-p$, so $p=cd-d=(c-1)d$. So either $c-1=p$ and $d=1$, or $c-1=1$ and $d=p$. Now work your way back up to $a$ and $b$.