TITLE: Enumeration of rationals from Stein-Shakarchi's Real Analysis (Chapter 1, Exercise 24)
QUESTION [14 upvotes]: The exercise is from Stein-Shakarchi's Real Analysis (Chapter 1, ex. 24). 

Does there exist an enumeration $\{r_{n}\}_{n=1}^\infty$ of the rationals such that the complement of $\bigcup_{n=1}^{\infty}{\left(r_{n}-\frac{1}{n},r_{n}+\frac{1}{n}\right)}$ in $\mathbb{R}$ is non-empty. [Hint: Find an enumeration where the only rationals outside of a fixed bounded interval take the form $r_n$, with $n=m^2$ for some integer $m$.]

While, I understand that we probably need some enumeration of the rationals such that the only rationals outside a fixed bounded interval are of the form $r_{m^{2}}$ for some $m$, I'm having trouble seeing how to get such an enumeration.
As always, help is very appreciated :)

REPLY [6 votes]: I think the way this problem was intended to be solved is as follows, though it is similar to one above. And it's short.
We denote all rationals in $[0,1]$ as $\{p_{n}\}$ and those in $\mathbb{R}-[0,1]$ as $\{q_{n}\}$. Now let's construct $\{r_{n}\}$ as follows: if n is a square of some integer, we take the next one in $\{q_{n}\}$; otherwise we take the next one from $\{p_{n}\}$. It is easy to proof that $\cup(r_{n}-\frac{1}{n},r_{n}+\frac{1}{n})\subset[-1,2]\cup(\cup(q_{n}-\frac{1}{n^{2}},q_{n}-\frac{1}{n^{2}}))$. Take summation we will find the right side has finite measure.