4.015. Calculate

$$
\left(1+3^{2}+5^{2}+\ldots+(2 n-1)^{2}+\ldots+199^{2}\right)-\left(2^{2}+4^{2}+6^{2}+(2 n)^{2}+\ldots+200^{2}\right)
$$
## Solution.

From the condition we have

$$
\begin{aligned}
& 1+3^{2}+5^{2}+\ldots+(2 n-1)^{2}+\ldots+199^{2}-2^{2}-4^{2}-6^{2}-(2 n)^{2}-\ldots-200^{2}= \\
& =(1-2)^{2}+\left(3^{2}-4^{2}\right)+\left(5^{2}-6^{2}\right)+\ldots+\left((2 n-1)^{2}-(2 n)^{2}\right)+\ldots+\left(199^{2}-200^{2}\right)= \\
& =(1-2)(1+2)+(3-4)(3+4)+(5-6)(5+6)+\ldots+(2 n-1-2 n)(2 n-1+2 n)+ \\
& +\ldots+(199-200)(199+200)=-3-7-11-\ldots-(4 n-1)-\ldots-399
\end{aligned}
$$

From here, \(a_{1}=-3, d=-4, a_{n}=-399\). Using the formulas (4.4) and \(n=\frac{a_{n}-a_{1}}{d}+1\), we get

$$
S_{n}=\frac{-3-399}{2}\left(\frac{-399+3}{-4}+1\right)=-20100
$$

Answer: -20100.