The sum of the first n integers

We mentioned the famous story of Gauss who as a young student was given the task to sum up the first 100 integers. The story is nicely told in the great movie Measuring the world. Here is that scene. Buettner: 1 plus 2, plus 3, plus 4 plus 5 plus... 6... plus 7, and continue in the same manner, until 100. And that nobody disturbs me until you have the solution. - Gauss gives up? Kid: he will get punished! Buettner: Where do you have this from? Gauss: this was not the issue, we were required to add up all the numbers from 1 to 100. 1 and 100 gives 101, 2 and 99 gives 101, 3 and 98 gives 101. Always 101. One can do this 50 times. And 50 times 101 is 5050. Buettner: Gauss: go to the corner! Shut up and stay here after class. Buettner: God sees everything. You know that. Gauss: yes. Buettner: come here. Your word of honor: did you do this yourself? Gauss: that was not difficult. One has only to .... Buettner: The summation formula of the geometric progression. Higher arithmetic. Take it with you. Read it. [ Narrator: The teacher Buettner, who would have guessed, was a kind of mathematician. He had published papers and one glorious day even got a reply of Immanuel Kant. But because his hard work and power was not sufficient, he became a school teacher. ] Gauss: My father can not pay this. Buettner: you will in the future take home many books and not pay. But be careful! One stain, one dog ear or a ripped page, and you will feel the stick, so that God will have mercy with you. Go now.