1

This can be reformulated as finding the number of integer solutions to $x_1 + x_2 + \cdots + x_n = \frac{n(n+1)}{2} - n = \frac{n(n-1)}{2}$ such that $0 \leq x_i \leq n-1$ for each $x_i$.

My first instinct was to use generating functions and attempt to determine the coefficient attached to $x^{\frac{n(n-1)}{2}}$ in the expansion of $(1 + x + \cdots + x^{n-1})^n = \left(\frac{1-x^n}{1-x}\right)^n$ but wasn’t sure how to proceed.

Alternatively, inclusion-exclusion seems like it could get really messy here, and I’m unsure if I’m overlooking something such as the parity of $n$ that’ll be an important factor in solving. Any input on how to tackle this would be greatly appreciated!

  • Your specific Math problem is solved by the answer given to a more generic problem. See this answer. – user2661923 Oct 09 '22 at 09:33
  • Re previous comment, note that (for example), the number of integer solutions to $x_1 + x_2 = k,$ where $x_1,x_2$ are each required to be greater than $(0)$ is the same as the number of non-negative integer solutions to $y_1 + y_2 = (k-2).$ Note the change of variable $y_i = x_i - 1 ~: ~i \in {1,2}.$ – user2661923 Oct 09 '22 at 09:36

0 Answers0