Algorithm expressing a fraction as a sum of unit fractions

197 Views Asked by At

I am looking for an algorithm to express some fraction $\frac{a}{b}$, with $a,b \in \mathbb{Z}$, as a sum of unit fractions, like:

$$\frac{a}{b} = \frac{1}{w_1} \pm \frac{1}{w_2} \pm \frac{1}{w_3} \pm ... \pm \frac{1}{w_i}$$

I know of the Greedy Algorithm for Egyptian Fractions:

(https://en.wikipedia.org/wiki/Greedy_algorithm_for_Egyptian_fractions#)

but this only generates positive fractions, whereas the ability to use negative fractions can decrease the number of terms needed. Also, the greedy algorithm often generates expansions with terms whose denominators are far larger than necessary.

I do not need the fractions to be positive, and I do need the denominators to be relatively small. Does anybody know of such an algorithm? Thanks