<s>[INST] $n^{th}$ determinant Find determinant $D_n$ of matrix $$
        \begin{bmatrix}
        1 & 1 & \cdots & 1 & -n \\
        1 & 1 & \cdots & -n & 1 \\
        \vdots & \vdots & \ddots & \vdots & \vdots \\
        1 & -n & \cdots & 1 & 1 \\
        -n & 1 & \cdots & 1 & 1
        \end{bmatrix}
$$
After multiplying first row by $-1$ and adding to $n-1$ rows:
$$
        \begin{vmatrix}
        1 & 1 & \cdots & 1 & -n \\
        0 & 0 & \cdots & -n-1 & n+1 \\
        \vdots & \vdots & \ddots & \vdots & \vdots \\
        0 & -n-1 & \cdots & 0 & n+1 \\
        -n & 1 & \cdots & 1 & 1
        \end{vmatrix}
$$
Second and $n-1$ row are changing place:
$$
        \begin{vmatrix}
        1 & 1 & \cdots & 1 & -n \\
        0 & -n-1 & \cdots & 0 & n+1 \\
        \vdots & \vdots & \ddots & \vdots & \vdots \\
        0 & 0 & \cdots & -n-1 & n+1 \\
        -n & 1 & \cdots & 1 & 1
        \end{vmatrix}
$$
Multiplying first row by $n$ and adding it to $n$-th row:
$$
        \begin{vmatrix}
        1 & 1 & \cdots & 1 & -n \\
        0 & -n-1 & \cdots & 0 & n+1 \\
        \vdots & \vdots & \ddots & \vdots & \vdots \\
        0 & 0 & \cdots & -n-1 & n+1 \\
        0 & n+1 & \cdots & n+1 & 1-n^2
        \end{vmatrix}
$$
Adding second to $n$-th row:
$$
        \begin{vmatrix}
        1 & 1 & \cdots & 1 & -n \\
        0 & -n-1 & \cdots & 0 & n+1 \\
        \vdots & \vdots & \ddots & \vdots & \vdots \\
        0 & 0 & \cdots & -n-1 & n+1 \\
        0 & 0 & \cdots & n+1 & (1+n)(2-n)
        \end{vmatrix}
$$
Adding $n-1$ to $n$-th row:
$$
        \begin{vmatrix}
        1 & 1 & \cdots & 1 & -n \\
        0 & -n-1 & \cdots & 0 & n+1 \\
        \vdots & \vdots & \ddots & \vdots & \vdots \\
        0 & 0 & \cdots & -n-1 & n+1 \\
        0 & 0 & \cdots & 0 & (1+n)(3-n)
        \end{vmatrix}
$$
Product on main diagonal gives $$D_n=(n+1)(3-n)(-n-1)^{n-2}$$
This is not correct. What is wrong with this upper triangular transformation?
 [/INST] You have only dealt with the second and $n-1$th row.  There is also the third and $n-2$nd row; 4th and $n-3$rd row, and so on.
</s>