2023 AIME I Problem 10

There exists a unique positive integer a for which the sum

U=\sum_{n=1}^{2023}\left\lfloor\frac{n^{2}-n a}{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.)