Find the largest integer $p$ such that $p+2013$ perfectly divides $[(p^{2013})+(p^{2012})+ .... +(p^2)+p+1]$ Find the largest integer $p$ such that $p+2013$ perfectly divides $[(p^{2013})+(p^{2012})+ .... +(p^2)+p+1]$
My approach:
Remainder when $p^{2012} + p^{2011} + \ldots + p + 1$ is divided by $p + 2012$ is
$R = 2012^{2012} - 2012^{2011} + 2012^{2010} - \ldots - 2012 + 1$.
This should be divisible by $p + 2012$.
So maximum value of $p$ will be $R - 2012$
$$
\max p = {(2012^{2013} + 1)/2013} - 2012.
$$

Let q=p+2013,
$\sum{_{0≤r≤2013}(p^r)}=\sum{_{0≤r≤2013}(q-2013)^r}≡\sum{_{0≤r≤2013}(-2013)^r}(mod\ q)$  as $(a-b)^n≡(-b)^n(mod\ a)$
So, q(=p+2013) must divide $\sum{_{0≤r≤2013}(-2013)^r}=\frac{(-2013)^{2014}-1}{(-2013-1)}$
