4. Fill the $4 \times 4$ grid with the integers from 1 to 16 such that the sum of the numbers in each row and each column is a multiple of $n$ (where $n>1$ and $n \in \mathbf{N}$), and these sums are 8 different multiples of $n$. Then the value of $n$ is $\qquad$.
4. 2,4 .

First, note that the sum of the integers from $1 \sim 16$ is 136. Let $s_{i}$ and $t_{i}$ be the sums of the numbers in the $i$-th row and the $i$-th column, respectively, where $i=1,2,3,4$. By the problem, $s_{i}=a_{i} n, t_{i}=b_{i} n$, where $a_{i} 、 b_{i}(i=1,2,3,4)$ are 8 different positive integers. Therefore,
$$
\begin{array}{l}
2 \times 136=\sum_{i=1}^{4}\left(s_{i}+t_{i}\right) \\
=n \sum_{i=1}^{4}\left(a_{i}+b_{i}\right) \geqslant n \sum_{k=1}^{8} k=36 n .
\end{array}
$$

Solving this, we get $n \leqslant 7$.
Since $n \mid s_{i}$, it follows that
$$
n \mid \sum_{i=1}^{4} s_{i},
$$

which means $n \mid 136$.
Given that $136=2^{3} \times 17$, we have $n=2,4$.

As shown in Figure 5, this is one way to fill the grid that meets the requirements.