0

Give a function $g : \mathbb{N} \times \mathbb{N} \to \mathbb{N}$

such that $g$ is one-to-one and onto function.

the onto part I could easily solve but every function I think of, is not one-to-one.

Ahmad
  • 1,380
  • 1
  • 18
  • 37
  • 1
    Here's a one-to-one function from ${1,2,3,\ldots}\times{1,2,3,\ldots}$ to ${1,2,3,\ldots}{:}$ $$ \begin{array}{c|cccccccccc} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & \cdots \ \hline 1 & 1 & 2 & 4 & 7 & 11 & 16 & 22 \ 2 & 3 & 5 & 8 & 12 & 17 & 23 \ 3 & 6 & 9 & 13 & 18 & 24 \ 4 & 10 & 14 & 19 & 25 \ 5 & 15 & 20 & 26 \ 6 & 21 & 27 \ 7 & 28 \ \vdots \end{array} $$ If the pattern is not clear, consider this: $\qquad$ – Michael Hardy Jan 03 '18 at 14:41
  • If the pattern is not clear, consider this: $$ \begin{array}{c|cccccccccc} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & \cdots \ \hline 1 & & & & & & & 22 \ 2 & & & & & & 23 \ 3 & & & & & 24 \ 4 & & & & 25 \ 5 & & & 26 \ 6 & & 27 \ 7 & 28 \ \vdots \end{array} $$ – Michael Hardy Jan 03 '18 at 14:41

1 Answers1

5

There are two standard examples: $$(x,y)\mapsto y+\frac{(x+y)(x+y+1)}{2},$$ it is technical to prove it is a bijection and not too interesting.

The other one is given by: $$(x,y)\mapsto 2^x(2y+1)-1,$$ it is bijective essentially from the fundamental theorem of arithmetic.

C. Falcon
  • 19,042