TITLE: Messed permutations
QUESTION [8 upvotes]: Here's an exercise from an old Egyptian textbook published in 1828. I'll try to preserve the main idea while translating it into English.
Let $k\geq2$ be a natural number. Consider a premutation $\sigma\in S_k$ defined on $k^*=\{1,...,k\}$. Define the messing number of $\sigma$ as $m(\sigma)=\min\{|i-j|+|\sigma(i)-\sigma(j)|:i,j\in k^*,i\neq j\}$. Prove that the maximal messing number $\max\{m(\theta):\theta\in S_k\}$ is at most $4$.
I'm pretty sure that there is a mistake but yet didn't find a counterexample. If you manage to find the counterexample (i.e. some permutation with messing number $\geq 5$) or prove that the assertion is true, then please let me know it! Also, if the statement is wrong, what is the lower bound of the maximal messing number?

REPLY [5 votes]: Suppose $k > 2n^2$ and $\gcd(k,n)=1$
Take $\sigma(i) = in \mod k$.
Then $\sigma(i)-\sigma(j)=(i-j)n \mod k$
If $i \neq j$, then this will be at least $n$. We do have to worry that if $(i-j)n > \frac k2$, then taking the modulus will decrease its absolute value, but if $|i-j| < n$, then we don't have that problem. So at least one of $|i-j|$ and $|\sigma(i)-\sigma(j)|$ will be at least $n$.
Mike Earnest has a tighter bound, but this a simpler proof that arbitrarily large messed numbers are possible.