-1

I am using $\mathbb{N}[i]$ for the Guassian integers that have non-negative real and imaginary components. We can create an ordering on them in the following way : First we will look to magnitude, then we will look to angle. We say that $a+bi<c+di$ when $|a+bi|\leq |c+di|$ and $|a+bi|=|c+di|\implies \tan^{-1}(b/a)<\tan^{-1}(d/c)$.

Consider an "unpairing" function which maps $\mathbb{N}\rightarrow \mathbb{N} [i]$.

$f(n)= x_n+y_ni $ such that $ n < m \implies f(n)<f(m)$. This function is well defined.

$ \begin{align} & f(0)=0 \\ & f(1)=1 \\ & f(2)=i \\ &f(3)=1+i \\ &f(4)=2 \\ &f(5)=2i \\ &f(6)=2+i \\ &f(7)=1+2i \\ \end{align} $

Circle Pairing Function

Question:

Is there an explicit formula for $f(n)?$ I can think of an algorithm but not one which is very impressive. I mean: where shall we place $f(1000) =re^{\pi \theta i}$? We know that $r\approx \sqrt{1000}$. But then what's $\theta$? Must we really compute $f(1) \dots f(999)$ to figure this out?

Motivation: I have been thinking about pairing/unpairing functions. It might be useful to have an unpairing function based circles.

Mason
  • 3,792
  • I think finding explicit pairing/unpairing functions for this mapping will be difficult. Have you considered the alternative "diagonal lines" mapping that uses $a+b$ instead of $|a+bi|$ and then orders by increasing $b$ within each $a+b$ value. – gandalf61 Jun 29 '18 at 09:13

1 Answers1

1

This is a well defined pairing function, but there is no known unpairing function. If there were, it would solve the Gauss circle problem, the number of points in the plane inside a circle of radius $r$. We have approximations to that, but no exact form seems to be known.

Ross Millikan
  • 374,822
  • Oh wow. Thanks. I think you may have inadvertently answered another question of mine... Is it generally the case we don't have nice form for $\sum_{n=0}^{r^2} r_k(n)$? Where $r_k(n)$ is the number integer solutions on the $k$ dimensional hypersphere with radius $\sqrt{n}$. I asked about $\sum_{n=0}^{r_2}{r_8(n)}$ over here. – Mason Aug 11 '18 at 04:28
  • 1
    This says it is not known for dimension two. For dimension one it is trivial. The Wikipedia article hints that it is hard in higher dimensions as well. Some problems become easier in higher dimension, but I suspect this is not one. – Ross Millikan Aug 11 '18 at 04:31