$2 \cdot 67$ For what value of $n$ does there exist a permutation $\left\{x_{1}, x_{2}, \cdots\right.$, $\left.x_{n}\right\}$ of $\{1,2, \cdots, n\}$ such that for $k=1,2, \cdots, n,\left|x_{k}-k\right|$ are all different?
[Solution] Clearly, $\left|x_{k}-k\right|$ can only take $n$ different values: $0,1, \cdots, n-1$. If for $k=1,2, \cdots, n,\left|x_{k}-k\right|$ are all different, then they must be $0,1, \cdots, n-1$ each appearing once. Also, since $\left|x_{k}-k\right| \equiv x_{k}-k(\bmod 2)$, summing over $k$ we know
$$
\frac{1}{2} n(n-1)=\sum_{k=1}^{n}\left|x_{k}-k\right| \equiv \sum_{k=1}^{n}\left(x_{k}-k\right)=0(\bmod 2) .
$$

From this, we can deduce that $4 \mid n$ or $4 \mid n-1$.
(1) When $n=4 m$, a permutation that meets the requirements is as follows:
$$
\begin{array}{l}
4 m-1,4 m-2, \cdots, 3 m+1,3 m-1,3 m-2, \cdots, 2 m, 4 m, \\
2 m-1,2 m-2, \cdots, m+1,3 m, m, m-1, \cdots, 1 .
\end{array}
$$
(2) When $n=4 m+1$, a permutation that meets the requirements is as follows:
$$
\begin{array}{l}
4 m, 4 m-1, \cdots, 3 m+2,3 m, 3 m-1, \cdots, 2 m+1,4 m+1, \\
2 m, 2 m-1, \cdots, m+1,3 m+1, m, m-1, \cdots, 1 .
\end{array}
$$

In summary, a permutation that meets the requirements exists if and only if $4 \mid n$ or $4 \mid n-1$.