3. If the integer $n$

satisfies
$$
(n+1)^{2} \mid\left(n^{2015}+1\right) \text {, }
$$

then the minimum value of $n$ is $\qquad$
3. -2016 .

From $n^{2015}+1=(n+1) \sum_{i=0}^{2014}(-1)^{i} n^{2014-i}$, we know
$$
\begin{array}{l}
(n+1)^{2} \mid\left(n^{2015}+1\right) \\
\left.\Leftrightarrow(n+1)\right|_{i=0} ^{2014}(-1)^{i} n^{2014-i} \\
\Leftrightarrow(n+1) \mid \sum_{i=0}^{2014}(-1)^{i}(-1)^{2014-i} \\
\Leftrightarrow(n+1) \mid \sum_{i=0}^{2014}(-1)^{2014} \\
\Leftrightarrow(n+1) \mid 2015 .
\end{array}
$$

Therefore, the minimum value of $n$ is -2016.