I would like to define a function from Z --> ZxZ that is both onto and one to one. I think it is going to have to be a piecewise function, but I am totally lost on how to get started. What I do know is that the function can be represented graphically by a spiral where the inputs and outputs look something like this:
I know this is only for positive Z, and this is part of the reason I am stuck. I am also not sure how to represent this info as a function. Any help would be appreciated. This is bugging the crap out of me. Thank you.
Apr 7th 2013, 09:21 PM
Re: Z --> ZxZ Function
It may be easier to write a bijection , so that is a bijection. For example, take
It remains to find a bijection . The standard one is the Cantor pairing function
This last function makes precise the usual snake-like enumeration diagram for .
The function you want is . Since each function in the composition is a bijection, the result is also a bijection.