I am solving a problem such that for every given number between range (inclusive of boundary integers), I calculate the sum of the modified value of those numbers. For example,