0

A question regarding a bijection between $\mathbb N^2$ and $\mathbb N$. I know about cantor pairing function but I wanted to ask about a bijection I have seen around the site which is $n=2^{u-1}(2v-1)$.

Can anyone explain why is this bijection surjective (I understand how it's injective) as it seems to give only values of $\mathbb N_{even}$ (power of 2 which is even times an odd number).

Thank you

1 Answers1

1

It is surjective because if $n\in\mathbb N$ and you write $n$ as $2^ab$, with $a\in\mathbb{Z}_+$ and $b$ and odd natural, then the function that have in mind maps $\left(a+1,\frac{b+1}2\right)$ into $2^ab=n$.