Compute $S = \sum_{k=0}^{m} \left\lfloor \frac{k}{2}\right\rfloor$ I want to compute the following sum
$$S = \sum_{k=0}^{m} \left\lfloor \frac{k}{2}\right\rfloor.$$
Here is what I tried:
$$ S = \sum_{k\geq 0, 2|k}^{m} \left\lfloor \frac{k}{2}\right\rfloor + \sum_{k\geq 0, 2\not |k}^{m} \left\lfloor \frac{k}{2}\right\rfloor.$$
If $m= 2t$ then 
$$S =\sum_{k\geq 0, 2|k}^{m} \left\lfloor \frac{k}{2}\right\rfloor + \sum_{k\geq 0, 2\not |k}^{m} \left\lfloor \frac{k}{2}\right\rfloor = \frac{t(t+1)}{2} + \frac{(t-1)t}{2} = t^2.$$
If $m= 2t+1$ then 
$$S = \sum_{k\geq 0, 2|k}^{m} \left\lfloor \frac{k}{2}\right\rfloor + \sum_{k\geq 0, 2\not |k}^{m} \left\lfloor \frac{k}{2}\right\rfloor = \frac{t(t+1)}{2} + \frac{t(t+1)}{2}= t(t+1).$$
But I am not sure if this is correct. Perhaps someone could give an indication. 

Yes, you are correct. You may also write the result as a more compact formula:
$$\sum_{k=0}^{m} \left\lfloor \frac{k}{2}\right\rfloor=
\begin{cases} 
t^2&\text {if $m=2t$}\\
t(t+1)&\text {if $m=2t+1$}\\
\end{cases}=\left\lfloor \frac{m^2}{4}\right\rfloor.$$
Indeed, if $m=2t$ then
$$\left\lfloor \frac{m^2}{4}\right\rfloor=\left\lfloor t^2\right\rfloor=t^2$$
and if $m=2t+1$ then
$$\left\lfloor \frac{m^2}{4}\right\rfloor=\left\lfloor t^2+t+\frac{1}{4}\right\rfloor=t(t+1).$$
