Question:
Let $x_1, x_2, \dots, x_n$ be sequence of integers such that
- $-1 \leq x_i \leq 2$ for $i = 1, 2, \dots, n$.
- $x_1 + x_2 + \dots + x_n = 19$
- ${x_1}^2 + {x_2}^2 + \dots + {x_n}^2 = 99$
Determine the minimum and maximum possible values of $${x_1}^3 + {x_2}^3 + \dots + {x_n}^3$$
Attempt:
To simply the problem, the domain $-1 \leq x_i \leq 2$ is simplified to integers $-1, 1, 2$ since $0$ is of no use other than elongate $n$ to $\infty$. Also pairs of both positive would be impossible since (2) above would overshoot $19$ to meet the requirements of (3). Thus we are left with the following options, $(-1, 1)$ and/or $(-1, 2)$. To determine the quantity/plausibility of each of our options, we determine the number of $-1$ and $1$ for $(-1, 1)$ and so on.
For (-1, 1), Let $x$ be the number of $-1$ and $y$ be the number of $1$: $$x+y = 99; -x + y = 19$$ $$x = 40, y = 59$$
For (-1, 2), we have no integer solution, thus we are left with the $(-1, 1)$.
That being said, ${x_1}^3 + {x_2}^3 + \dots + {x_n}^3$, would be $(-1)^3*40 + 1*59 = 19$ for both maximum and minimum values.
Can someone check if my reasoning is correct.