<s>[INST] $1^2 - 2^2 + 3^2 - 4^2 + \dots + 1999^2$ using closed form formula for sum of squares of first $n$ natural numbers The question is simple, the solution, not so much
Q.Find the sum of the given expression $1^2- 2^2 + 3^2 - 4^2 + \dots + 1999^2$
My idea is we know $1^2 + 2^2 + 3^2 + 4^2 + \dots + n^2 = \frac{n(n + 1)(2n +  1)}{6}$
So for $n=1999$ I get the sum as $2,66,46,67,000$
From this I need to subtract the squares of the even terms twice because subtracting once leaves with only the sum of the squares of the odd nos.
I observed something :
$2^2 + 4^2 + 6^2 + \dots + 1998^2 = (2 \cdot 1)^2 + (2 \cdot 2)^2 + \dots + (2 \cdot 999)^2$
Therefore to obtain the sum of the square of the even terms, I can take $4$ as common and use the aforementioned formula for $n=999$ and multiply it by $4$.
therefore sum of square of even terms = $1,33,13,34,000$
I need to subtract this sum twice to get the answer, because subtracting once simply leaves me with the sum of the squares of the odd numbers.
The answer is now $1999000$, which still doesn't match the answer key. Can someone explain where I am going wrong ?
 [/INST] We can use the identity $$(x+1)^2-x^2=x+1+x$$
to tackle the sum in 2 simpler ways:
Way 1
$$ \begin{aligned}&1^2 - 2^2 + 3^2 - 4^2 + 5^2-... -1998^2+ 1999^2
\\=& 1+(2+3)+(4+5)+…+(1998+1999)
\\= &19990000\end{aligned}$$
Way 2
$$ \begin{aligned}&(1^2 - 2^2 + 3^2 - 4^2 + 5^2-6^2...-1998^2)+ 1999^2
\\=&-((1+2)+(3+4)+(5+6)+…+(1997+1998))+1999^2
\\= &19990000\end{aligned}$$
</s>