2x^2 - 2x - 40 = 2x^2 -10x + 8x - 40 = 2x(x - 5) + 8(x - 5)
= (x-5)(2x+8) = 2(x-5)(x+4)
Let's start from what we know.

Note that:

(sign of last term will be + when n is even and - when n is odd).
Sum is finite so we can split it into two sums, first

with only positive trems (squares of even numbers) and second

with negative (squares of odd numbers). So:

And now the proof.
1) n is even.
In this case, both

and

have

terms. For example if n=8 then:

Generally, there will be:

Now, calculate our sum:



So in this case we prove, that:

2) n is odd.
Here,

has more terms than

. For example if n=7 then:

So there is

terms in

,

terms in

and:

Now, we can calculate our sum:




We consider all possible n so we prove that:
140/7=20
220/20=11
the answer is 11
X = -4
y = 0
8x-12y+32 = 24