I encountered this problem yesterday and successfully solved it. I'm interested in seeing other people's approach to solving this problem.

Problem: How many ordered pairs $(a, b)$ are solutions to $\frac{1}{a} + \frac{1}{b} = \frac{1}{100}$ where $a, b \in \mathbb{Z}$?

Edit: The solution is:


  • 5
    $\begingroup$ If you already solved it, it'd help to present your solution to avoid repeats. $\endgroup$
    – JessicaK
    Apr 28, 2015 at 17:29
  • 2
    $\begingroup$ But then everyone would know the answer? $\endgroup$
    – EgoKilla
    Apr 28, 2015 at 17:31
  • 2
    $\begingroup$ @EgoKilla If you're truly interested in people's approaches, this shouldn't be an issue. $\endgroup$
    – naslundx
    Apr 28, 2015 at 17:35
  • 2
    $\begingroup$ @naslundx Okay I'll write it up right now. $\endgroup$
    – EgoKilla
    Apr 28, 2015 at 17:36
  • $\begingroup$ @EgoKilla Incidentally, you can write answers with hidden text, which would let you provide your own solution without immediately giving it away. Start each line with >! and end it with two spaces. $\endgroup$
    – Théophile
    Apr 28, 2015 at 17:48

6 Answers 6


Here's my solution.

So we start with $\frac{1}{a} + \frac{1}{b} = \frac{1}{100}$. We can rewrite this as $$\frac{100}{a} + \frac{100}{b} = 1$$ $$100a + 100b = ab$$ $$ab - 100a - 100b = 0$$ $$ab - 100a - 100b + 100^2 = 10000$$ $$(a - 100)(b - 100) = 10000$$

So now I realize my solutions $(a, b)$ correspond to the negative and positive factors $(a - 100) = f$, $(b-100) = g$ where $fg = 10000$.

Then I find the prime factorization of $10000 = 2^45^4$. So we have $5\cdot5 = 25$ possible positive factors of $10000$. Corresponding to $50$ positive and negative solutions. Except I realized we have to exclude the pair $(-100, -100)$ factors of $10000$ since these correspond to the pair $(a, b) = (0, 0)$ and we can't divide by zero.

Therefore there are $49$ solutions.


This reminded me of problem 454 on project Euler which I wrote an algorithm for a year ago. (Here is the algorithm if anyone is interested)

So here is how I would solve this question.

Observe that

$$\frac{1}{2} = \frac{1}{3} + \frac{1}{6} \\ \frac{1}{3} = \frac{1}{4} + \frac{1}{12} \\ \frac{1}{4} = \frac{1}{5} + \frac{1}{20}$$

which can be generalized into

$$\frac{1}{a} = \frac{1}{a+1} + \frac{1}{a^2+a}$$

So immediately we get our first solution:

$$\frac{1}{100} = \frac{1}{101} + \frac{1}{10100}$$

Note the equation above can be further generalized into

$$\frac{1}{a} = \frac{1}{(a+n)} + \frac{n}{a^2+an}$$

in which case $n$ can be converted into 1 as long as $n$ is divisible by $a^2+an$. Thus to find all solutions to the equation is basically to find how many distinct $n$'s are there that are divisible by $a^2$ - how many factors do $a^2$ have.

Note: the question is asking for the number of ordered pairs, in which case the summation of 2 distinct fractions count as 2.


We have $$\dfrac1a+\dfrac1b = \dfrac1{n}$$ This means we have $$n(a+b) = ab \implies ab - n a -n b = 0 \implies (a-n)(b-n) = n^2$$ Hence, each divisor pair of $n^2$ gives a possible value for $a$ and $b$, i.e., if $d_1d_2 = n^2$, we can set $a=n+d_1$ and $b=n+d_2$ to obtain all solutions. Hence, the number of pairs is the number of divisors (both positive and negative) of $n^2$.

  • 2
    $\begingroup$ This isn't exactly true, see my answer. $\endgroup$
    – EgoKilla
    Apr 28, 2015 at 17:45

Taking seriously the request for alternative approaches, here's one that'll work if you don't mind doing a large (but finite) amount of trial and error:

After noting that $a=b=200$ is one solution, we can count the rest by doubling the number of solutions with $0\lt|a|\lt |b|$. These we can find after observing that $|b|\gt|a|\ge200$ implies

$$\left|{1\over a}+{1\over b}\right|\le{1\over|a|}+{1\over|b|}\lt{1\over200}+{1\over200}={1\over100}$$

so it suffices to look in the range $-199\le a\le 199$ (skipping $a=0$), to see how often $b=100a/(a-100)$ is an integer whose absolute value is greater than $|a|$.

Please note, I am not saying this is a smart way to solve the problem, just that it's an approach that is guaranteed to work.


If you multiply through by $100ab,$ you get

\begin{equation*} 100b+100a=ab\\ \Rightarrow 0=ab-100a-100b \\ \Rightarrow (a-100)(b-100)=10000 \end{equation*}

(the $10000$ is there to get rid of the $-100\times -100$).

Equate the Right side with the brackets on the left to get the pairs.


$$ab=100(a+b)$$ $$(a-100)(b-100)=10^4$$


You must log in to answer this question.

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