Suppose $ P(x) \equal{} a_nx^n\plus{}\cdots\plus{}a_1x\plus{}a_0$ be a real polynomial of degree $ n > 2$ with $ a_n \equal{} 1$, $ a_{n\minus{}1} \equal{} \minus{}n$, $ a_{n\minus{}2} \equal{}\frac{n^2 \minus{} n}{2}$ such that all the roots of $ P$ are real. Determine the coefficients $ a_i$.
Given the polynomial \( P(x) = x^n - nx^{n-1} + \frac{n^2 - n}{2}x^{n-2} + \cdots + a_1x + a_0 \), we need to determine the coefficients \( a_i \) under the condition that all roots of \( P \) are real.

1. **Identify the roots and their sums:**
   Let \( x_1, x_2, \ldots, x_n \) be the roots of \( P(x) \). By Vieta's formulas, we know:
   \[
   s_1 = \sum_{i=1}^n x_i = n
   \]
   \[
   \sigma_2 = \sum_{1 \leq i < j \leq n} x_i x_j = \frac{n(n-1)}{2}
   \]

2. **Calculate the sum of squares of the roots:**
   Using the identity for the sum of squares of the roots:
   \[
   s_2 = \sum_{i=1} x_i^2 = s_1^2 - 2\sigma_2
   \]
   Substitute the known values:
   \[
   s_2 = n^2 - 2 \cdot \frac{n(n-1)}{2} = n^2 - n(n-1) = n^2 - n^2 + n = n
   \]

3. **Calculate the sum of squared differences of the roots:**
   The sum of squared differences of the roots is given by:
   \[
   \sum_{1 \leq i < j \leq n} (x_i - x_j)^2
   \]
   This can be expressed as:
   \[
   \sum_{1 \leq i < j \leq n} (x_i^2 + x_j^2 - 2x_i x_j) = (n-1)s_2 - 2\sigma_2
   \]
   Substitute the known values:
   \[
   \sum_{1 \leq i < j \leq n} (x_i - x_j)^2 = (n-1)n - 2 \cdot \frac{n(n-1)}{2} = n(n-1) - n(n-1) = 0
   \]

4. **Conclude that all roots are equal:**
   Since the sum of squared differences is zero, it implies that all roots are equal. Let \( x_i = c \) for all \( i \). From \( s_1 = \sum_{i=1}^n x_i = nc \), we have:
   \[
   nc = n \implies c = 1
   \]
   Therefore, all roots \( x_i = 1 \).

5. **Determine the coefficients \( a_i \):**
   Since all roots are 1, the polynomial can be written as:
   \[
   P(x) = (x-1)^n
   \]
   Expanding this using the binomial theorem:
   \[
   P(x) = \sum_{k=0}^n \binom{n}{k} (-1)^{n-k} x^k
   \]
   Therefore, the coefficients \( a_i \) are given by:
   \[
   a_i = (-1)^{n-i} \binom{n}{i}
   \]

The final answer is \( \boxed{ a_i = (-1)^{n-i} \binom{n}{i} } \).