Upper bound for the sum of the multiplication of adjacent items of a list

23 Views Asked by At

If $\sum_{i=1}^n x_i = X$, where $X$ is a positive constant and $\forall i, x_i$ is a positive integer, then what is the upper bound of $\sum_{i=1}^{n-1} (x_i x_{i+1})$?

Intuitively, set $ x_1=\dots=x_n=\frac {X}{n}$, and then we obtain the maximum?