2005+2004-2003+2002+2001-2000+1999+1998-1997+…+1006+1005-1004
=2005+2004+2003+……+1004-2*(2003+2000+……+1004)
=(2005+1004)*(2005-1004+1)/2-2*(2003+1004)*[(2003-1004)/3+1)/2
=1507509-1004338
=503171
2005+2004-2003+2002+2001-2000+1999+1998-1997+…+1006+1005-1004
=2005+2004+2003+……+1004-2*(2003+2000+……+1004)
=(2005+1004)*(2005-1004+1)/2-2*(2003+1004)*[(2003-1004)/3+1)/2
=1507509-1004338
=503171