Untitled

등비 수열의 합 공식 이용

function solution(a, b) {
    return (a + b) * (Math.abs(b - a) + 1) / 2
}