2. Find the largest integer $n$ such that
$$
\frac{n^{2007}+n^{2006}+\cdots+n^{2}+n+1}{n+2007}
$$
is an integer.
2. Let $f(n)=n^{2007}+n^{2006}+\cdots+n^{2}+n+1$. As a geometric series, we have
$$
f(n)=\frac{n^{2008}-1}{n-1} .
$$

Using Division Algorithm, we can write
$$
f(n)=\frac{n^{2008}-1}{n-1}=(n+2007) g(n)+R
$$
where $g(n)$ is integer-valued function, and $R=f(-2007)=\frac{2007^{2008}-1}{-2008}$, which is an integer, so that
$$
f(n)=(n+2007) g(n)-\frac{2007^{2008}-1}{2008} .
$$

So that $f(n)$ is divisible by $n+2007$, we need $n+2007$ to be a factor of $R$. To find the largest integer $n$, we should have
$$
n+2007=\frac{2007^{2008}-1}{2008} \quad \text { or } \quad n=\frac{2007^{2008}-1}{2008}-2007 .
$$