TITLE: How can I prove that every rational number can be expressed as the sum of $1/n$? (for a set of integer n chosen by a certain algorithm)
QUESTION [7 upvotes]: So there is this extra exercise in my textbook. I looked it over with the TA and neither of us could solve it. The exercise goes like this:
Let $\alpha$ be positive and rational. Then, choose the smallest natural number $N_0$ such that $1/N_0 \leq \alpha$. Now let $\alpha_1=\alpha-1/N_0$. Now choose $N_1$ as the smallest natural number such that $1/N_1 \leq \alpha_1$ etc.
The exercise is to prove that this algorithm terminates for every rational $\alpha$. (i.e. at some point $\alpha_i=N_i$ and it will end as $0$) It's easy to prove that $\alpha_i$ becomes arbitrarily small, but I don't see any approach to prove it reaches zero.

REPLY [3 votes]: For any given $p$ and $q$. Since series $\left\{ 1 \over n \right\}$ diverge, there must exist an integer $n$ that:
$$
\sum_{i=1}^{n} \frac 1 i \le \frac p q \lt \sum_{i=1}^{n+1} \frac 1 i = \sum_{i=1}^{n} \frac 1 i + \frac 1 {n+1}
$$
Assume 
$$
x_0 = \frac p q - \sum_{i=1}^{n} \frac 1 i \lt \frac 1 {n+1}
$$
If $x_0=0$ trivial case, if $x \ne 0$, Then we can find coprime integer $a$ and $b$ that
$$
x_0 = \frac a b \lt \frac 1 {n+1}
$$
Finally we decomposite $\frac a b$, there must exist an integer $m_0$, where $m_0 \gt n$ and
$$
\frac 1 {m_0+1} \le \frac a b \lt \frac 1 {m_0}\\
$$
Then let
$$
x_1 = \frac a b - \frac 1 {m_0+1} = \frac {am_0+a-b}{b(m_0+1)}
$$
Since
$$
x_1 < \frac 1 {m_0} - \frac 1 {m_0+1} < \frac 1 {m_0+1}
$$
So we can repeat this step.
And from $\frac a b < \frac 1 {m_0}$, we have:
$$
am_0 < b\\
am_0 - b < 0\\
am_0 + a - b < a
$$
So the numerator of $x_i$ is strictly decreasing, so we can find $x_k = 0$ in no more than $a$ steps.
Finally
$$
\frac p q = \sum_{i=1}^n \frac 1 i + \sum_{i=0}^{k-1} \frac 1 {m_i}
$$