I am trying to figure out how to sum a minimum functions, i.e.
$$\sum_{i=0}^{\lfloor\frac{m}{2}\rfloor} \sum_{j=0}^{\lfloor\frac{n}{2}\rfloor} \min \Bigl( m - 2i, \lfloor\frac{n-2j}{2}\rfloor\Bigr)$$
and
$$\sum_{i=0}^{\lfloor\frac{m-1}{2}\rfloor} \sum_{j=0}^{\lfloor\frac{n-1}{2}\rfloor} \min \Bigl( m - 2i - 1, \lfloor\frac{n-2j-1}{2}\rfloor\Bigr)$$
And I have no idea how to do this sum without specifying $m$ and $n$. Are there any resources that offer a tutorial on doing this type of sum?
Thank you
We calculate the first sum with even $m$ and $n$. The other cases can be treated similarly.
We obtain
Comment:
In (1) we substitute $m=2M$ and $n=2N$ and get rid of the floor symbols.
In (2) we exchange the order of summation $i\to M-i, j\to N-j$ and we also let the indices start with $1$ since $i=0$ and $j=0$ does not contribute anything.
In (3) we sum up the inner sum dependent on the index $i$ of the outer sum and use Iverson brackets $[[P]]$ to prevent overcounting.
Now it's time to harvest. We collect the results (4) to (7) and put them into the intermediate result (3).
Note: The results might be simplified by using \begin{align*} \left\lfloor\frac{N-1}{2}\right\rfloor=\left\lfloor\frac{N-1}{2}\right\rfloor\quad\Longleftrightarrow\quad N\equiv 1(2)\quad\Longleftrightarrow\quad n\equiv 2(4)\\ \left\lfloor\frac{N-1}{2}\right\rfloor+1=\left\lfloor\frac{N}{2}\right\rfloor\quad\Longleftrightarrow\quad N\equiv 0(2)\quad\Longleftrightarrow\quad n\equiv 0(4)\\ \end{align*}
Hint: Chapter 3 in Concrete Mathematics by R.L. Graham, D.E. Knuth and O. Patashnik contains a thorough introduction of floor and ceiling functions.