Assume is a constant and solve for :
Since both and must be integers, figure out for which values of is an odd perfect square (it needs to be odd since otherwise, will not be an integer).
Edit: Also must be nonnegative and ... That leaves only 8 solutions.
Here are the first two:
or .
Every solution with will have another solution since adding all of the numbers from to will give zero, then you just have the same integers from to from the initial solution. Hence, if you find three more solutions with , then you have found all of the solutions.
Yes, 8 solutions. To be honest I would have said only 4 solutions, not realizing until reading SlipEternal's post that each solution a, a+1, a+2,...a+n has a counterpart of -(a-1), -(a-2), -(a-3) ... a-3, a-2, a-1, a, a+1, a+2,...a+n. My approach is to check the value of the median number in the series of n integers to see if it "makes sense" - for n odd the median number must be an integer, and for n even the mediian must be an integer + 1/2. This is because the starting number of the sequence of n terms is (500/n)-(n-1)/2. If this is an integer you have a sequence of n terms that adds to 500. I found four values for n that work, so using SlipEternal's idea that means there are a total of 8.
ebaines idea is easier to use. Solve for instead of solving for . Then you have . Now, let's consider cases where is an integer.
Case 1: 2 divides n
Then (n+1) must divide 500. Since (n+1) must be odd, we know as those are the only odd factors of 500.
Case 2: 2 does not divide n.
Then n must be odd and n+1 must be even. But, n+1 cannot divide 500. It must divide 1,000, though. Moreover, must be odd. Since the only odd factors of 1,000 are the odd factors of 500, we have .
Those are all eight solutions.