第 685 题:(2023 AIME I, 10)
There exists a unique positive integer $a$ for which the sum \[U=\sum_{n=1}^{2023}\left\lfloor\dfrac{n^{2}-na}{5}\right\rfloor\] is an integer strictly between $-1000$ and $1000$. For that unique $a$, find $a+U$. (Note that $\lfloor x\rfloor$ denotes the greatest integer that is less than or equal to $x$.)
- $\sum_{n=1}^{2023}n(n-a)=\sum n^2-a\sum n=\bigl(\sum n\bigr)\bigl(\frac{2\cdot2023+1}3-a\bigr)=\bigl(\sum n\bigr)(1349-a)$. Changing $a$ by $1$ changes $U$ by about $\frac15\sum n\approx409000$, so we need $a=1349$.
- Then $U=\frac15\sum\big(n(n-a)-r_n\big)=-\frac15\sum r_n$, where $r_n$ is the remainder of $n(n-1349)\equiv n(n+1)$ mod $5$, namely $0,2,1,2,0$ for $n\equiv0,1,2,3,4$.
- Each block of five contributes $5$; $2023=5\cdot404+3$ and the last three give $2+1+2$. So $\sum r_n=2025$ and $U=-405$.
- $a+U=944$. The answer is $\boxed{944}$.
There exists a unique positive integer $a$ for which the sum \[U=\sum_{n=1}^{2026}\left\lfloor\dfrac{n^{2}-na}{3}\right\rfloor\] is an integer strictly between $-1000$ and $1000$. For that unique $a$, find $a+U$. (Note that $\lfloor x\rfloor$ denotes the greatest integer that is less than or equal to $x$.)