4. The integer values of $n$ that satisfy the equation $\left(n^{2}-5 n+5\right)^{n+1}=1$ are $\qquad$ .

Translate the text above into English, please retain the original text's line breaks and format, and output the translation result directly.
4. $1,4,3,-1$.
$\left(n^{2}-5 n+5\right)^{n+1}=1$ holds in three possible cases.
(1) $n^{2}-5 n+5=1 \Leftrightarrow n=1$ or 4.
(2) $n^{2}-5 n+5=-1$, and $n+1$ is even $\Leftrightarrow n=3$.
$$
\begin{array}{l}
\text { (3) } n+1=0 \text {, and } n^{2}-5 n+5 \neq 0 \\
\Leftrightarrow n=-1 .
\end{array}
$$