Hey i will be happy to get some hint on how it can be done.
in class i saw an example on how it can be done by mapping it in a "spiral" way.
but i cant find an explicit function that works.
the numbering is(0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1), (1,-1),(2,-1), (2,0), (2,1) (2,2), (1,2), etc.
Asked
Active
Viewed 140 times
0

A1337
- 1
-
2Minor variant of Cardinality of the set of all pairs of integers – YuiTo Cheng May 04 '19 at 12:17
-
Describing the spiral using words is an explicit function that works. Functional formulas are not always necessary, and I would argue in this case even directly unhelpful, as it is just going to be cluttered and difficult to read. – Arthur May 04 '19 at 12:30
-
Unfortunately my professor don't thinks this way :( – A1337 May 04 '19 at 12:38
-
Similar: https://math.stackexchange.com/questions/1196451/bijection-from-mathbbz-to-mathbbz-times-mathbbz and https://math.stackexchange.com/questions/42942/how-can-i-index-2-dimensional-points-starting-at-the-origin-and-going-outwards and https://math.stackexchange.com/questions/521029/fast-bijective-mathbbz-times-mathbbz-rightarrow-mathbbz – Gerry Myerson May 04 '19 at 13:43