Let $k\in\mathbb{Z}\_{>0}$, and $s\in\mathbb{N}$, and for $m\_1,\ldots,m\_k$ some nonnegative integers, consider the problem of maximizing the product
$$
(1+m\_1)(1+m\_2)\cdots(1+m\_k)
$$
under the constraint $m\_1+\cdots+m\_k=s$.


I would like to know:


1. The exact formula $M(k,s)$ for the maximal value of the product.
2. A complete description of the tuples $(m\_1,\ldots,m\_k)$ which achieve the maximum.


Of course with the $m\_i$ taking continuous real values, this is just the equality case of the arithmetic mean-geometric mean inequality and maximization calls for $m\_i$'s that are "as equal to each other as possible", but forcing integer values makes this rather messy.


I can try to work my way through this, but it would feel like reinventing the wheel.
A solution to 1. and 2. or pointer to the relevant literature would be appreciated.



A discrete optimization problem related to the AM-GM inequality
This was essentially answered by Nate in the comments, but here are some more details. As Nate argues, $|m\_i - m\_j| \leq 1$ for all distinct $i,j$. Thus, if $s=ak+r$, where $a,r \in \mathbb{N}$ and $r < k$, then there is a unique choice (up to permuting variables) which maximizes the product. Namely, set $r$ of the variables to $\lceil s/k \rceil$ and the rest to $\lfloor s/k \rfloor$.


This problem is related to [Turán's Theorem](https://en.wikipedia.org/wiki/Tur%C3%A1n%27s_theorem), which concerns the maximum possible number of edges in a graph on $s$ vertices with no $K\_{k+1}$ subgraph. The answer is given by the Turán graph, which is unique. More generally, Zykov proved that among $K\_{k+1}$-free graphs, the Turán graph also has the most number of complete graphs $K\_t$ for all $t \leq k$. The case $t=k$ leads to your optimization problem (once you have already established that such a graph must be $k$-partite).


