If $a$ and $b$ are positive integers, and $\frac{1}{a} + \frac{1}{b}$ is an integer, prove that $a=b$. And show that $a = 1$ or $2$

-I played around with numbers and the conditions and it seems that it's common sense that if $a = b$ then $a = b = 1$ or $2$, For example:

If $a = b = 4$, then $\frac{1}{a} + \frac{1}{b}$ would not be an integer.

-Any help is appreciated

  • 1
    $\begingroup$ Presumably you want $a$ and $b$ to be integers. Without loss of generality $a\le b$. Observe that $a=1$ and $b\gt 1$ does not work. Observe that $a=2$, $b\gt 2$ does not work, sum is too small. Observe that $a\ge 3$ does not work. $\endgroup$ Feb 7, 2016 at 0:28
  • $\begingroup$ So I am basically proving this by cases? Eventually leading to the point that a can ONLY be 1 or 2. $\endgroup$ Feb 7, 2016 at 0:29
  • $\begingroup$ Yes, it is cases, crude but it works. $\endgroup$ Feb 7, 2016 at 0:32
  • $\begingroup$ Proving by exhaustion works in this case, but @Jane 's method (see her answer below) is more elegant. $\endgroup$
    – tomi
    Feb 7, 2016 at 0:33

4 Answers 4


Suppose $a>b$, then $\frac{1}{a}+\frac{1}{b}<\frac{2}{b}$, and since $\frac{1}{a}+\frac{1}{b}$ is integer with $a>0, b>0$, $$\frac{2}{b}>\frac{1}{a}+\frac{1}{b}\geq1$$or, $2>b$, hence $2>b>0$, and $b=1$.

Hence, $\frac{1}{a}+\frac{1}{b}=\frac{1}{a}+1$ is integer, and so $a=1$ (because $\frac{1}{a}$ is positive integer).

But this is a contradiction, since we supposed that $a>b$. Therefore $a \le b$.

Similarly, if we start by suposing that $a<b$ we find again that $a=b$ : a contradiction. So $a \ge b$.

Combining these two statements gives $a=b$ as required.

In addition, $\frac{1}{a}+\frac{1}{b}=\frac{2}{a}$ is integer, so, since $a>0$, we have $a=1$ or $a=2$.

  • $\begingroup$ based on the above comment about the necessity of "integer" conditions. $\endgroup$
    – Kerr
    Feb 7, 2016 at 0:31

The question originally left out the condition that $a$ and $b$ are integers.

Without that condition, the statement is not true.

Consider the counter-example:

$a=\frac 25$ and $b= \frac 27$

$\frac 1a + \frac 1b= \frac 52 + \frac 72 = 6$

Now that the question has been altered, this is no longer an answer, but I shall leave it here unless downvoted.

  • $\begingroup$ I guess it was implicit. $\endgroup$
    – Bernard
    Feb 7, 2016 at 0:31
  • $\begingroup$ @Bernard: I have edited it to make it explicit. $\endgroup$
    – TonyK
    Feb 7, 2016 at 0:43
  • $\begingroup$ @TonyK: I think you did well. On this site, it can be useful for many users. $\endgroup$
    – Bernard
    Feb 7, 2016 at 0:45

If $\frac1a + \frac1b = \frac{a+b}{ab}$ is an integer, then $a$ and $b$ both divide $a+b$. This means that $a$ divides $(a+b)-a=b$ and that $b$ divides $(a+b)-b=a$. So $a$ and $b$ divide each other, whence they must be equal.

Now if $\frac1a + \frac1b = \frac2a$ is an integer, then $a$ must divide $2$. So $a=1$ or $a=2$.


A variant (supposing $a,b$ are natural numbers):

Say $a\le b$. The hypothesis means $ab=a+b\le 2b$, whence $a\le 2$. Furthermore $b\mid a+b$, hence $a+b-b=a$, so that $a=b$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .