Let $n ~(\ge 8)$ be an integer and $n=n_1+n_2+\cdots +n_k$ where every $n_i$ is an positive integer and $2 \le k <n$. Without loss of generality, we can assume that $n_1 \ge n_2 \ge \cdots \ge n_k.$
Are there exact expressions for the upper and lower bounds of the following expression?
$$f(n_1,n_2,\cdots n_k):=\binom{n_1}{2}+\binom{n_2}{2}+\cdots +\binom{n_k}{2}$$
Note that $\binom{1}{2}=0$.
I did some calculations for some special cases.
For $n=8$ and $k=2$, we have
$$\max f=f(7,1)=21$$ and $$\min f=f(4,4)=12.$$
Now if $k=3$, then we have
$$\max f=f(6,1,1)=15$$ and $$\min f=f(3,2,2)=7.$$
It seems that we have
$$\max f:=f(\lceil \frac{n}{2}\rceil,\lfloor \frac{n}{2}\rfloor)$$ and $$\min f:=f(2,\underbrace{1,1,1\dots,1}_{n-2}).$$