2007 SMT Team Round Problem 6

Problem

$x\equiv\left(\sum_{k=1}^{2007} k \right) \mod 2016$, where $0\leq x\leq 2015$. Solve for $x$.

Solution

The summation will give us $1+2+3+\cdots+2006+2007=\frac{2007\times2008}2=2007\times1004$. Because $2007\equiv-9\mod 2016$, so $2007\times1004\equiv-9\times1004\equiv-9036\mod 2016$. So, we have $-9036\equiv-9036+2016\times5\equiv1044$, and because $0\leq1044\leq2016$, our answer is $\boxed{\mathrm{1044}}$.

~Yuhao2012