# Finding perfect two terms Egyptian fraction

If I have two unity fractions, like $$\frac{1}{12} + \frac{1}{180}$$, for instance. These two fractions can be re-writen as $$\frac{1}{15} + \frac{1}{45}$$ or even $$\frac{1}{18} + \frac{1}{30}$$, which satisfies the Egyptian Fraction concept of maximising the value of the smallest fraction. Is there a formula or an algorithm that when followed, one can find out all the possible equal pairs of any unity fraction pair?

This might be worth something.

Let $$x=p/q, p

Then $$1, where [] is the greatest integer function or floor.

Now $$[q/p], but we need to add additional fractions $$1/[p/q]$$ to get $$p/q$$. This is not possible since the first term already exceeds the fraction. So we have to add 1 to the denominator as we go.

So $$p/q=\frac{1}{1+[q/p]}+u/v$$.

$$u/v=p/q-\frac{1}{1+[q/p]}<1$$ and the next term is $$\frac{1}{1+[v/u]}$$

$$p/q=\frac{1}{1+[q/p]}+\frac{1}{1+[v/u]}+...$$

This iterative process generates the Egyptian Fractions for a given number.

For a given rational number $$\dfrac{c}{d}$$, we wish to find all pairs of positive integers $$(a,b)$$ such that $$\dfrac{c}{d} = \dfrac{1}{a}+\dfrac{1}{b}.$$

We can manipulate the equation as follows: $$cab = da+db$$ $$cab - da-db = 0$$ $$c^2ab-cda-cdb = 0$$ $$c^2ab-cda-cdb+d^2 = d^2$$ $$(ca-d)(cb-d) = d^2.$$

Hence, $$ca-d$$ and $$cb-d$$ must be complementary factors of $$d^2$$. So the pairs of positive integers $$(a,b)$$ such that $$\dfrac{c}{d} = \dfrac{1}{a}+\dfrac{1}{b}$$ are all of the form $$(a,b) = \left(\dfrac{f_1+d}{c},\dfrac{f_2+d}{c}\right)$$ for all integers $$f_1,f_2$$ such that $$d^2 = f_1f_2$$ and both $$\dfrac{f_1+d}{c}$$ and $$\dfrac{f_2+d}{c}$$ are integers.