# Finding closed form of a summation $\sum_{i = \lfloor{\frac{n}{2}}\rfloor}^{n}i$

So i'm trying to find the clsoed form of

$\sum_{i = \lfloor{\frac{n}{2}}\rfloor}^{n}i$

from what I know its probably going to be $? * (\lfloor{\frac{n}{2}}\rfloor + n)$ based on when I wrote out the summation and based it on what I've been told about gauss sum.

I've tried $\lceil{\frac{n}{4}}\rceil * (\lfloor{\frac{n}{2}}\rfloor + n)$ But this only seems to work when there is an even number of terms being added up.

I just don't know where to go beyond here.

Well we have that $$\sum_{i=\lfloor n/2\rfloor}^{n}i=\sum_{i=1}^{n}i-\sum_{i=1}^{\lfloor n/2\rfloor -1}i$$ at which point we can apply the well known partial sum formula $\sum_{i=1}^{k}=k(k+1)/2$ to get \begin{aligned} \sum_{i=\lfloor n/2\rfloor}^{n}i &=\frac{n(n+1)}{2}-\frac{\lfloor n/2\rfloor (\lfloor n/2\rfloor - 1)}{2} \\ &= \frac{(n-\lfloor n/2\rfloor +1)(n+\lfloor n/2\rfloor)}{2} \end{aligned} And if you want this can be simplified into cases for when $n$ is even and when $n$ is odd.
Hint: do it by cases depending on whether $n$ is even or odd. You can then express the lower limit of the sum easily in terms of $n$ and sum the series. There is no shame in having a different closed form for even and odd $n$ at the end. If that offends you, you can fix it by using $(-1)^n$ to combine the cases.