4. Given the equation $x+8 y+8 z=n(n \in \mathbf{N})$ has 666 sets of positive integer solutions $(x, y, z)$. Then, the maximum value of $n$ is . $\qquad$
4.304.

When $m>1, m \in \mathbf{N}$,
$y+z=m$ has $m-1$ sets of positive integer solutions.
The original equation also has $m-1$ sets of positive integer solutions.
$$
\begin{array}{l}
\because 1+2+\cdots+(m-1)=666, \\
\therefore \frac{1}{2} m(m-1)=666 .
\end{array}
$$

Solving gives $m=37$ or -36 (discard).
$$
\therefore 1+8 \times 37 \leqslant n \leqslant 8+8 \times 37=304 \text {. }
$$