Sum of a series of minimums I should get sum of the following minimums.Is there any way to solve it?
$$\min\left\{2,\frac{n}2\right\} + \min\left\{3,\frac{n}2\right\} + \min\left\{4,\frac{n}2\right\} + \cdots + \min\left\{n+1, \frac{n}2\right\}=\sum_{i=1}^n \min(i+1,n/2)$$
 A: If $n$ is even, your sum splits as
$$\sum_{i=1}^{\frac{n}{2}-2} \min\left(i+1,\frac{n}{2}\right)+\frac{n}{2}+\sum_{i=\frac{n}{2}}^{n} \min\left(i+1,\frac{n}{2}\right)=\sum_{i=1}^{\frac{n}{2}-2} (i+1)+\frac{n}{2}+\frac{n}{2}\sum_{i=\frac{n}{2}}^{n} 1$$
If $n$ is odd, you can perform a similar split:
$$\sum_{i=1}^{\frac{n-3}{2}} (i+1)+\frac{n}{2}\sum_{i=\frac{n-1}{2}}^{n} 1$$
A: Suppose first that $n$ is even, say $n=2m$. Then $$\min\left\{i,\frac{n}2\right\}=\min\{i,m\}=\begin{cases}i,&\text{if }i\le m\\
m,&\text{if }i\ge m.
\end{cases}$$
Thus, $$\begin{align*}
\sum_{i=2}^{n+1}\min\left\{i,\frac{n}2\right\} &= \sum_{i=2}^m i + \sum_{i=m+1}^{n+1} m\\
&= \frac{m(m+1)}2-1 + (n+1-m)m\\
&= \frac12\left(\frac{n}2\right)\left(\frac{n}2+1\right)-1+\left(\frac{n}2\right)\left(\frac{n}2+1\right)\\
&= \frac{3n(n+2)}{8}-1\\
&=\frac{3n^2+6n-8}8.
\end{align*}$$
If $n$ is odd, say $n=2m+1$, $$\min\left\{i,\frac{n}2\right\}=\min\left\{i,m+\frac12\right\}=\begin{cases}i,&\text{if }i\le m\\
m+\frac12,&\text{if }i> m.
\end{cases}$$
Thus, $$\begin{align*}
\sum_{i=2}^{n+1}\min\left\{i,\frac{n}2\right\} &= \sum_{i=2}^m i + \sum_{i=m+1}^{n+1} \left(m+\frac12\right)\\
&= \frac{m(m+1)}2-1 + (n+1-m)\left(m+\frac12\right)\\
&= \frac12\left(\frac{n-1}2\right)\left(\frac{n+1}2\right)-1+\left(\frac{n}2\right)\left(\frac{n+3}2\right)\\
&= \frac{3n^2+6n-1}{8}-1\\
&= \frac38 (n^2+2n-3).
\end{align*}$$
