Did you know that if you add the numbers from 1 to 100 you get 5050? And you don't have to count them one by one. You can use the famous Gauss method instead.
1 + 2 + 3 + 4 + 5 + ... + 95 + 96 + 97 + 98 + 99 + 100 = ?
Gauss discovered that the sum of the first and last number (1 + 100 = 101) is equal to the sum of the second and penultimate (2 + 99 = 101). Thus he came to the conclusion that every similar pair has the same sum (101).
He then found the number of pairs (100 : 2 = 50) and multiplied it by the sum of the pairs: 50 . 101 = 5050.

According to the Gauss method, to solve problems with sums, it is enough to see how many pairs with the same sum we have and multiply their number by this sum.
How to solve Gaussian problems in a few steps:
1. We determine the number of all numbers that participate in the sum. If our first number is not 1, then we subtract the first from the last number and add 1.
For example:
5 + 6 + 7 + 8 + ... + 19 + 20 + 21
We find the number of numbers in the row like this: (21 - 5) + 1 = 17
2. We determine the number of all groups (pairs of numbers) in the row that have the same sum. We need to check whether the number of numbers in the row is even or odd.
If the number of numbers is an even number, like 100 for example, then we will have 100 : 2 = 50 pairs of numbers with the same sum.
If the number of numbers is an odd number, then we separate the last number and add it to the sum at the end.
For example, if we need to find the sum of the numbers from 1 to 101, we will have 100 : 2 = 50 pairs of numbers with the same sum and the number 101.
3. We find the sum of the numbers in each of the pairs by adding the first and last numbers.
For example:
1 + 2 + 3 + ... + 8 + 9 + 10
In this row we have 5 pairs of numbers (10 : 2 = 5), and the sum of the numbers in each of the groups is 11 (10 + 1 = 11).
4. We multiply the number of groups by the sum of the numbers in each of the groups and find the sum. If the number of numbers is an odd number and we have separated the last number, we add it at the end!
Let's go back to the example above and find the sum of the numbers from 1 to 101:
The number of pairs is: 100 : 2 = 50 pairs of numbers + the number 101
The sum of each group of numbers is: 100 + 1 = 101
The sum in the row is: (50 . 101) + 101 = 5050 + 101 = 5151