Let $n\in \mathbb{N}\setminus\{0,1\}$, let $(x_1,\dots,x_n)\in(\mathbb{N^\ast})^n$, and let $i\in \{1,\dots,n\}$.
I would like to compute $$\sum_{j\neq i}\sum_{k\neq i,j}\sum_{l\neq j,k}(x_l-1).$$
I find (looking a some examples) $(n-1)(n-2)(x_i-1)+(n-3)(n-2)\left(\sum_{j\neq i} x_j\right)$. Could somebody confirm?
The term $x_i - 1$ appears once for each of $(n - 1)(n - 2)$ choices of the ordered pair $(j, k)$.
For $l \ne i$, the term $x_l - 1$ appears once for each of $(n - 2)(n - 3)$ choices of $(j, k)$.
So the sum is: \begin{align*} & \phantom{=} (n - 1)(n - 2)(x_i - 1) + (n - 2)(n - 3)\sum_{l \ne i}(x_l - 1) \\ & = (n - 1)(n - 2)x_i - (n - 1)(n - 2) + (n - 2)(n - 3)\sum_{l \ne i}x_l - (n - 1)(n - 2)(n - 3) \\ & = (n - 1)(n - 2)x_i + (n - 2)(n - 3)\sum_{l \ne i}x_l - (n - 1)(n - 2)^2 \\ & = 2(n - 2)x_i + (n - 2)(n - 3)\sum_{l=1}^nx_l - (n - 1)(n - 2)^2. \end{align*}