=-1009+(2+6+10+...+2014+2018-4-8-12-...-2016-2020)=
=-1009+2*(1+3+5+...+1007+1009)-4*(1+2+3+...+504+505)=
(1+3+..1009)->progr aritmetica de ratie 2
formula: ((a1+an)*n)/2 a1 este primul termen
an este ultimul
r=ratie=a2-a1=3-1=2
an=a1+(n-1)r=>
1009=1+(n-1)2
1009=1+2n-2
1009=2n-1
2n=1010
n=505
1+2+3....+505->suma lui Gauss
formula an(an+1)/2
an este ultimul termen adica 505
=-1009+2(1+1009)*505/2-4*505*506/2=
=-1009+2*1010*505/2-4*505*253=
=-1009+2*505*505-4*505*253=
=-1009+505(2*505-4*253)=
=-1009+505(1010-1012)=
=-1009+505*(-2)=
=-1009-1010=
=-2019