I was trying to construct an explicit bijection $f:\mathbb{N} \to \mathbb{Q}^+$, but unable to do so. I google it , & found a solution here in Stackexchange, which given below -
Let us first define Stern's diatomic series.
$a_1=1,a_{2k}=a_k,a_{2k+1}=a_k+a_{k+1}$
Let us list out the first few terms.
$a_1=1$
$a_2=a_1=1$
$a_3=a_1+a_2=1+1=2$
$a_4=a_2=1$
$a_5=a_2+a_3=1+2=3$
$a_6=a_3=2$
$a_7=a_3+a_4=2+1=3$
$a_8=a_4=1$
Now to obtain the nth rational number, we define $f:\mathbb{N} \to \mathbb{Q}^+$, by $f(n)={a_n\over a_{n+1}}$.
Let us list out the first few terms.
$f(1)={a_1\over a_{1+1}}={1\over 1}$
$f(2)={a_2\over a_{2+1}}={1\over 2}$
$f(3)={a_3\over a_{3+1}}={2\over 1}$
$f(4)={a_4\over a_{4+1}}={1\over3}$
$f(5)={a_5\over a_{5+1}}={3\over2}$
$f(6)={a_6\over a_{6+1}}={2\over3}$
$f(7)={a_7\over a_{7+1}}={3\over1}$
etc.
Using this concept I have proved the injection of the function $f$. But when I'm trying to prove surjection by choosing an arbitrary $q\in \mathbb{Q}^+$, I'm unable to find the preimage in $\mathbb{N}$.
Please show me the proper way to proof the surjection rigorously.