ifaequals the sum of the even integers from 2 to 120 , inclusive , andbequals the sum of the odd integers from 1 to 119 , inclusive , what is the value of a - b ?
"this is a solution from beatthegmat : even numbers : ( 120 - 2 ) / 2 + 1 = 60 even integers . ( 120 + 2 ) / 2 = 61 is the average of the even set . sum = avg * ( # of elements ) = 61 * 60 = 3660 = a odd numbers : ( 119 - 1 ) / 2 + 1 = 60 odd integers . ( 119 + 1 ) / 2 = 60 is the average of the odd set . sum = avg * ( # of elements ) = 60 * 60 = 3600 = b a - b = 3660 - 3600 = 60 . answer : a"
subtract(multiply(divide(120, 2), add(divide(120, 2), 1)), multiply(divide(add(119, 1), 2), add(divide(subtract(119, 1), 2), 1)))