ifaequals the sum of the even integers from 2 to 20 , inclusive , andbequals the sum of the odd integers from 1 to 19 , inclusive , what is the value of b - a ?
"yes ! there is really a faster way to solve it . sum of consecutive odd or even integers = ( no . of odd or even ints ) * ( first int + last int ) / 2 here a = sum of even ints from 2 to 20 , inclusive number of even ints = 10 , first int + last int = 2 + 20 = 22 a = 10 * 22 / 2 = 110 b = sum of odd ints from 1 to 19 , inclusive number of odd ints = 10 , first int + last int = 1 + 19 = 20 a = 10 * 20 / 2 = 100 b - a = 100 - 110 = - 10 ans : a"
subtract(multiply(divide(20, 2), add(divide(20, 2), 1)), multiply(divide(add(19, 1), 2), add(divide(subtract(19, 1), 2), 1)))