Calculation method (formula)
The specific method is: the first and last items are multiplied by the number of items, and then divided by 2.
The number of items is calculated by subtracting the first item from the last item, dividing by the item difference (the difference between each item), and then adding 1.
For example: 1+2+3+4+5++N, expressed in letters: n( 1+n)/2.
Arithmetic progression's summation formula sn = (a1+an) n/2sn = n (2a1+(n-1) d)/2; D= tolerance Sn = An2+Bn;; A=d/2,B=a 1-(d/2)
Extended data:
Origin of algorithm
Gauss was very naughty when he was a child. In a math class, the teacher listed a difficult formula for them to calm down and let them work out the number 1+2+3+4+5+6+ ... one hour+100.
Only Gauss in the class gave the answer in less than 20 minutes, because he thought of using (1+100)+(2+99)+(3+98) ...+(50+51) ... * * There are 50 65438. Later, people called this simple algorithm Gaussian algorithm.
Johann Carl Friedrich Gauss (1April 30, 777-1February 23, 855), a famous German mathematician, physicist, astronomer and geodesist, was one of the founders of modern mathematics, considered as one of the most important mathematicians in history, and known as the "prince of mathematics".
Gauss ranks alongside Archimedes and Newton as the three greatest mathematicians in the world. He made great achievements in his life, with 1 10 achievements named after his name "Gauss", which is the highest among mathematicians. He made contributions to number theory, algebra, statistics, analysis, differential geometry, geodesy, geophysics, mechanics, electrostatics, astronomy, matrix theory and optics.