Calculation 1 + 3 + 5 + 7 +... + 29-2-4-6 -. - 28

Calculation 1 + 3 + 5 + 7 +... + 29-2-4-6 -. - 28

1 + 3 + 5 + 7 +... + 29-2-4-6 -. - 28 = (1 + 3 + 5 + 7 +... + 29) - (2 + 4 + 6 +... + 28) = [(1 + 29) * 14 / 2] - [(2 + 28) * 13 / 2] = 210-195 = 5, first extract the minus sign, then calculate it according to the formula of the sum of the arithmetic sequence, and then subtract it. The sum of the arithmetic sequence = (first item + last item) * number of items / 2 requires the sum of the arithmetic sequence, and the number of items must be calculated, Item number = (last first) / tolerance + 1 note: several numbers are arranged in a certain order to form a sequence. If the difference between any two adjacent numbers in the sequence is equal, we call the sequence isochronous. The first book is called the first item, and the last number is called the last item. The difference between two adjacent numbers is called tolerance, The sum formula of arithmetic sequence is as follows: sum of arithmetic sequence = (first item + last item) * number of items / 2 number of items = (last item - first item) / tolerance + 1 last item = first item + tolerance * (number of items - 1) first item = last item - tolerance * (number of items - 1)