TITLE: Fractions in Ancient Egypt
QUESTION [7 upvotes]: In ancient Egypt, fractions were written as sums of fractions with numerator 1. For instance,$ \frac{3}{5}=\frac{1}{2}+\frac{1}{10}$. Consider the following algorithm for writing a fraction $\frac{m}{n}$ in this form$(1\leq m < n)$: write the fraction $\frac{1}{\lceil n/m\rceil}$ , calculate the fraction $\frac{m}{n}-\frac{1}{\lceil n/m \rceil}$ , and if it is nonzero repeat the same step. Prove that this algorithm always finishes in a finite number of steps.
Note:if $ n\in \mathbf{Z} $ and $n-1<x\leq n ,  \lceil x\rceil=n$

REPLY [2 votes]: One can always show that any fraction can be written as a sum of finite fractions, by the factorial rule.  That is for $\frac mn$, if $n \mid  f!$ then any $\frac mn$ can be written in no more than $f-1$ steps.
For the greedy algorithm, a fraction $\frac mn$, for being greater than $\frac 1a$, will leave a difference $\frac {am-n}{na}$
Suppose you have $\frac 1c \le \frac mn \le \frac 1{c-1}$.  Multiply the limits by $\frac mm$ to get the denominators $cm > n > cm-c$, and thence put $n = cm-x$, where $x \lt m$.
Then subtract $\frac 1c$ to get $\frac {cm}{c(cm-x)} - \frac {cm-x}{c(cm-x)} = \frac x{c(cm-x)}$.  Since $x<m$, each iteration produces a smaller $x$, which must ultimately divide the denominator.