Infinite permutation: bijection $\pi:\Bbb N\to\Bbb N$. How to prove is really a bijection?

61 Views Asked by At

For example: http://oeis.org/A258746

$a(1) = 1, a(2) = 2, a(3) = 3$. For $n \geq 2$, $m = \lfloor \log_2(n)\rfloor$.
If $m$ even, then $a(2\cdot n) = 2\cdot a(n)$ and $a(2\cdot n+1) = 2\cdot a(n)+1$.
If $m$ odd, then $a(2\cdot n) = 2\cdot a(n)+1$ and $a(2\cdot n+1) = 2\cdot a(n)$

Is it bijective?

1

There are 1 best solutions below

1
On

Yes.

Assume $\pi$ is not onto ant let $n$ be the smallest value left out. Clearly $n>4$. If $n=2k+r$, $r\in\{0,1\}$, then $1\le k<n$, hence $k=a(i)$ for some $i$. Then wither $a(2i)=2k$, $a(2i+1)=2k+1$, or $a(2i)=2k+1$, $a(2i+1)=2k$. At any rate, $n$ occurs among $a(2i)$, $a(2i+1)$ - contradiction. Hence $\pi$ is onto.

Assume $\pi$ is not injective, i.e., there exist $n_1<n_2$ with $a(n_1)=a(n_2)$. Pick such a pair with $n_2$ minimal. Then $\lfloor n_1\rfloor<\lfloor n_2\rfloor$ as otherwise $a(n_2)=a(n_1)\pm1$. Hence $a(\lfloor n_1\rfloor)\ne a(\lfloor n_2\rfloor)$ and hence $\{2a(n_1),2a(n_1)+1\}$ and $\{2a(n_2),2a(n_2)+1\}$ are disjoint, but contain $a(n_1)$ and $a(n_2)$, respectively - contradiction.