For each permutation $\sigma$ of $ \left\{ 1, 2, \dots, n \right\}$ define $$\operatorname{dist}(\sigma)=\sum_{i=1}^{n}\left| \sigma (i)-i \right|$$ For each $n\in\mathbb{N}$, I'm interested in finding the maximum value this function can score, namely $$M_n=\max_{\sigma\in D_n}\left\{\operatorname{dist}(\sigma)\right\}$$
Does $M_n$ has a conventional name? Uses? Is there a formula to find it?
I've noticed that $M_n$ grows "in pairs", meaning that for each odd $a\in \mathbb{N}$ it holds that $$M_{a+1}-M_a=M_{a+2}-M_{a+1}$$
I guess it can represent some kind of measure for hardness to sort.
For a geometrical interpretation See that if $\sigma(m)$ and $(m)$ and $\sigma(j)$ and $j$ are on different sides then the distance between them is more than $DE+FG$