1. are we finished with f(a).b and when a is odd f(a)=-(a+1)/2 and when a is even f(a)=a/2 ?

2. Originally Posted by DrSteve
$\displaystyle \mathbb{N}\rightarrow \mathbb{N}\times \mathbb{N}\rightarrow \mathbb{Z}\times \mathbb{N}\rightarrow \mathbb{Q}$.

The first is the inverse of the pairing function. The second is the map $\displaystyle (a,b)\rightarrow (f(a),b)$ where f is the function we've previously discussed, and the third is the map $\displaystyle (a,b)\rightarrow a.b$.
For the function suggested by Plato, one can take $\displaystyle p_1(n)=\max\{k\in\mathbb{N}\mid\text{$2^k$divides$n$}\}+1$ and $\displaystyle p_2(n)=(n/p_1(n)+1)/2$. (One must check whether $\displaystyle p_1(n)$ and $\displaystyle p_2(n)$ need to assume 0 and whether they actually do.) Then $\displaystyle n\mapsto(p_1(n),p_2(n))$ is a bijection $\displaystyle \mathbb{Z}^+\to\mathbb{Z}^+\times\mathbb{Z}^+$, which is the first step in the chain at the top of this post.

3. Thanks emakarov - I didn't remember which direction was technically called the pairing function.

gutnedawg, you essentially got my idea right. The bijection $\displaystyle F:\mathbb{N}\rightarrow A$ is given by $\displaystyle F(n)=f(a).b$ where $\displaystyle f$ is the function you described and $\displaystyle \pi(a,b)=n$, where $\displaystyle \pi$ is the pairing function.

(Here $\displaystyle A$ is the set of rational numbers with terminating decimal expansions.)

Page 2 of 2 First 12