An algorithm for Egyptian fraction representations with restricted denominators
Greg Martin, Yue Shi
TL;DR
This work tackles the problem of representing a rational $r$ as a sum of unit fractions with denominators restricted to a finite multiset $D$, and provides a complete algorithm implemented in Scheme to enumerate all submultisets $D'\subset D$ with $R(D')=r$. The method centers on the deficit $\delta(D,r)=R(D)-r$ and uses a reserve/removal framework together with a key modular lemma to prune the search by removing multiples of prime powers, resulting in a depth-first enumerator $ufrac$ with an efficient kill procedure. A nontrivial early-stopping variant allows quick existence checks, and the paper presents substantial computational results including exact representations under dense-denominator restrictions and the densest-denominator function $G(r)$. The implementation and results enable systematic exploration of restricted-denominator Egyptian fractions and support verification of conjectures, with potential for parallelization and broader applications in number-theoretic fraction representations.
Abstract
A unit fraction representation of a rational number $r$ is a finite sum of reciprocals of positive integers that equals $r$. Of particular interest is the case when all denominators in the representation are distinct, resulting in an Egyptian fraction representation of $r$. Common algorithms for computing Egyptian fraction representations of a given rational number tend to result in extremely large denominators and cannot be adapted to restrictions on the allowed denominators. We describe an algorithm for finding all unit fraction representations of a given rational number using denominators from a given finite multiset of positive integers. The freely available algorithm, implemented in Scheme, is particularly well suited to computing dense Egyptian fraction representations, where the allowed denominators have a prescribed maximum.
