# Thread: One to one and onto function from R^3 to N

1. ## One to one and onto function from R^3 to N

Not sure if this is the appropriate place. Seems like an aglebraic topic.

I would like a one to one and onto function f that goes from N^3 to N. Something like

f(x,y,z) -> n.

Any ideas?

2. ## Re: One to one and onto function from R^3 to N

For every bijection $f:\mathbb{N}\times\mathbb{N}\to\mathbb{N}$, $g(x,y,z)=f(x,f(y,z))$ is a bijection from $\mathbb{N}\times\mathbb{N}\times\mathbb{N}$ to $\mathbb{N}$. For a bijection from $\mathbb{N}\times\mathbb{N}$ to $\mathbb{N}$ you can take the Cantor pairing function or $f(x,y)=2^x(2y+1)-1$.

3. ## Re: One to one and onto function from R^3 to N

Wow thank you so much! That is such a beautiful result