Ethem S. answered 10/28/19
Learn the Basics of Math and MATLAB with Former MIT Research Engineer
x = starting number = 40
n = number of terms = 10
We can write the series (40, 37, 34, 31...) as x-0*3, x-1*3, x-2*3, x-3*3, ...
Sum of the first 10 terms is
sumi(x-3*i), where i is from 0 to 9, x is 40
sumi(x-3*i) = sumi(x) -sumi(3*i) = sumi(x) - 3*sumi(i)
sumi(x) where i is from 0 to 9, means we sum x 10 times
sumi(x) where i is from 0 to 9 = 10*x = 400
sumi(i) , where i is from 0 to 9 = sumi(i) , where i is from 1 to 9 = n*n(+1)/2 = 9*10/2 = 45
sumi(x-3*i) = sumi(x) -sumi(3*i) = sumi(x) - 3*sumi(i) = 400 - 3*45 = 400 - 135 = 265