If we add the numbers 1 to 15, we get 120. If we add the numbers 6 to 20, how many do we get ?
195
The sum of the first n natural numbers is n(n + 1) ÷ 2; for 1 to 15 this gives 15 × 16 ÷ 2 = 120, as stated.
Sum of 6 to 20 = (sum of 1 to 20) − (sum of 1 to 5) = 20 × 21 ÷ 2 − 5 × 6 ÷ 2 = 210 − 15 = 195.
Using the given value instead: remove 1 to 5 (total 15) from 120 and add 16 to 20 (total 90), giving 120 − 15 + 90 = 195.
90 is only the sum of 16 to 20, and 105 is the sum of 6 to 15.
Hence, 195.
If 1 is added to each odd digit and 2 is subtracted from each even digit in the number 8317456, what will be the sum of the digits that are second from the left and second from the right?