Since each term is an absolute value, they will with one possible exception be greater than zero. (That one possible exception when a is a perfect square less than 2015, the term that corresponds to that value will be zero. All other values will be nonzero, and they are absolute values they will all be positive.)
so, all we have to do is find a single value where
| a - n2 | ≥ | a - 2015x1008 | = | a - 2031120|
Because there will be many other positive values added to it to make the larger expression larger still.
case 1 a> 2031120
if n=1 then a - 12 > a - 2031120
2031120 > 1 and there will other positive values added....
case 2 a < 2031120
a - n2 ≤ a - 2031120 as long as n >√2031120 then the absolute value function will make the smaller term of greater magnitude into the larger number, and there will be other positive values added....
case 3 a = 2031120
if n is greater OR less than √2031120 then | a - n2 | ≥ 0
if n = √2031120 (which it really shouldn't because it looks like n is an integer value) then you would have an equality with a few thousand positive terms being added to the left hand side.