There is a story that when Gauss was a child, the teacher, just to keep the class busy, made them add all integers from 1 to 100 (or 1000). Gauss wrote a single number on his paper.
He had thought of the sum as
S= 1+ 2+ 3+ ...+ 98+ 99+ 100 and then
S=100+ 99+ 97+ ...+ 3+ 2+ 1 so
2S= 101+ 101+ 101+ ...+ 101+ 101+ 101
2S is 101 100 times so 2S= 10100 and S= 5050.
Just as easily adding 1 to 1000, 2S is 1001 1000 times so 2S= 1001000 and
S= 500500.
For general "n"
S= 1+ 2+ 3+ ...+ (n-2)+ (n-1)+ n
S= n+ (n-1)+ (n- 2)+ ...+ 3+ 2+ 1 so
2S= (n+ 1)+ (n+ 1)+ (n+ 1)+ ...+ (n+1)+ (n+1)+ (n+1)
2S= n+1 n times so 2S= n(n+1) and \(\displaystyle S= \frac{n(n+1)}{2}\).