I'm new to analyzing algorithms and I'm having trouble translating this while loop into a summation:
c = 0
n = n - 2
while n > 0
c = c + (2 * n)
n = n - 2
end
At first, I thought that it would be $$\sum_{n=1}^{n-2} 2(n-2)$$
but I'm don't think this is correct since I'm not accounting for the decrement by 2.