TITLE: Do rearrangements of $\mathbb{N}$ necessarily have fixed points with respect to placement distance?
QUESTION [5 upvotes]: Let $f:\mathbb{N}\to\mathbb{N}$ be a bijection. Does there exist $\ n_1,n_2\in\mathbb{N},\ n_2>n_1, $ such that $\vert f(n_2)-f(n_1) \vert = n_2 - n_1\ ?$
I have tried coming up with counter-examples, but so far they all fail. But I'm not sure why they are failing.

REPLY [2 votes]: The greedy solution is to choose $f(1), f(2), f(3), \dots$ in order, and at every step to choose $f(n)$ to be the least natural number that does not create any problems so far. This produces the sequence
$$
    1, 3, 5, 2, 4, 9, 11, 13, 15, 6, 8, 19, 7, 22, 10, 25, \dots
$$
This is sequence A065188 in the OEIS; the "Greedy Queens" sequence. (The condition on $f$ is equivalent to asking us to place queens on the infinite chessboard $\mathbb N \times \mathbb N$ so that every row and column has a queen, and none of the queens attack each other; hence the name.)
A comment on the related sequence A269526 gives a proof that the greedily-constructed $f$ is a bijection; I will reproduce it here in a bit more detail. Suppose for the sake of contradiction that $m$ (for "missing") is the first value missing from the range of $f$.
For $i=1, \dots, m-1$, there is a value $f^{-1}(i)$ mapped to $i$ (by assumption), and this prevents $f^{-1}(i)+(m-i)$ from being equal to $m$. However, this type of constraint only happens finitely many times; we can choose $N$ larger than $f^{-1}(i)+(m-i)$ for any $i$. ($N$ is a capital letter because it's a big number.)
Here is the other way that the value $m$ can be blocked: whenever $f(x)=y$ for $y>m$, this means $f(x+y-m)$ cannot be $m$. This is the only time that $f(x)=y$ prevents a later value of $f$ from being $m$. So lots of values of $f$ must somehow be "dedicated" to blocking the value $m$; this will be a problem.
If $f(N), f(N+1), \dots, f(10N)$ are all blocked in this way, that means that at least $9N$ values of $f$ up to this point are used for blocking them: we have $f(x)=y$ with $x+y-m \le 10N$ for at least $9N$ values of $x$ less than $10N$. Equivalently, for at least $9N$ values of $x$ less than $10N$, $f(x) \le 10N+m-x$.
Now take a $10N$ by $10N$ chessboard, and whenever $m < f(x) \le 10N + m-x$, place a queen in row $x$ and column $f(x)-m+1$. We have placed at least $9N$ non-attacking queens on the chessboard... what's more, each of them is placed on or below the main antidiagonal!
However, yet another OEIS sequence, A274616, counts the maximum number of non-attacking queens that can be placed on such a triangular board with side $n$. That number is $\frac23 n$ rounded to the nearest integer: it is certainly not $\frac9{10}n$ for any $n$ as big as $10N$. Therefore no function $f$ that satisfies our other constraints can keep blocking $m$ for this long: eventually the value $m$ will also be attained.