9. Find all positive integers $n$ such that the set $\{1,2, \cdots, 4 n\}$ can be partitioned into $n$ four-element subsets: $M=\bigcup_{k=1}^{n} M_{k}$, where for each subset $M_{k}=\left\{a_{k}, b_{k}, c_{k}, d_{k}\right\}(k=1,2, \cdots, n)$, one of the elements $a_{k}, b_{k}, c_{k}, d_{k}$ is the arithmetic mean of the other three.
Let's assume $a_{k}=\frac{b_{k}+c_{k}+d_{k}}{3} \Rightarrow a_{k}+b_{k}+c_{k}+d_{k}=4 a_{k}$, thus $4 \left\lvert\, 1+2+\cdots+4 n=\frac{4 n(4 n+1)}{2}=2 n(4 n+1) \Rightarrow n\right.$ is even. When $n$ is even, divide $\{8(k-1)+1,8(k-1)+2, \cdots, 8 k\}$ into two groups: $\{8(k-1)+1,8(k-1)+5,8(k-1)+6,8 k\}$
and $\{8(k-1)+2,8(k-1)+3,8(k-1)+4,8(k-1)+7\}$.
It is easy to verify that $8(k-1)+5=\frac{8(k-1)+1+8(k-1)+6+8 k}{3}$,
$$
8(k-1)+4=\frac{8(k-1)+2+8(k-1)+3+8(k-1)+7}{3} .
$$

Therefore, the condition is satisfied if and only if $n$ is even.