4. Find all positive integers $n(n \geqslant 2)$, such that there exist integers $x_{1}, x_{2}, \cdots, x_{n-1}$, satisfying if $0<i 、 j<n(i \neq j)$, and $n \mid(2 i+j)$, then $x_{i}<x_{j}$.
4. $n=2^{k}(k \geqslant 1)$ or $3 \times 2^{k}(k \geqslant 0)$.

Assume $n$ has the aforementioned form. For a positive integer $i$, let $x_{i}$ be the largest positive integer such that $2^{x_{i}} \mid i$.
Assuming for $0n \text {, }
$$

is also impossible.
Now assume $n$ does not have the aforementioned form, and there exist $x_{1}, x_{2}, \cdots, x_{n-1}$ that satisfy the conditions.

For any positive integer $m$, let the remainder of $(-2)^{m}$ divided by $n$ be $a_{m}$. Then, since $n$ is not a power of 2, $a_{m}$ does not contain 0, and $a_{m} \neq a_{m+1}(m \geqslant 1)$ (otherwise, if $a_{m}=a_{m+1}$, then $\left.n \mid 3 \times 2^{m}\right)$. Furthermore, $n \mid\left(2 a_{m}+a_{m+1}\right)$, thus, there must be $x_{a_{1}}<x_{a_{2}}<\cdots$, which contradicts the fact that $a_{m}$ can only take a finite number of values.