The sum of the first item and the last item (that is, (1+ 1580)) is multiplied by the number of items (that is, 1580) and then divided by 2.
The end result is:
( 1+ 1580)* 1580/2= 1248990
Remember this in the future, arithmetic progression.
Very useful