How can I find the max value of $\sum_{i}^{n} \lfloor\frac{i}{k}\rfloor (k-1)$ with $k$ integer $\in [1,100]$? I can express this sum in terms of n and k (it's quite easy) but I'm not able to find its maximum ...
$\sum_{i}^{n} \lfloor\frac{i}{k}\rfloor (k-1) = \frac{m(k-1)(2N+2-mk-k)}{2}$ with m the greatest integer such that $mk \leq 100$
In order to calculate the sum we use Iverson brackets $[P]$ to cope with the floor function.
In order to find the maximum value of $$(k-1)\sum_{i=1}^n\left\lfloor\frac{i}{k}\right\rfloor$$ where $k\in[1\ldots 100]$, we approximate $\left\lfloor\frac{n}{k}\right\rfloor$ with $\frac{n}{k}$.