$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?
 A: Let $D_m$ be the determinant of the $m\times m$ matrix like this with $-n$ in the antidiagonal and $1$ everywhere else. You are seeking $D_n$.
Note for $k\leq n$, we can find a relation on $D_k$ as follows. Multiply the top row by $n-k+2$, thus scaling the determinant by $n-k+2$.
Then add rows $2$ through $k$ to the first row, which leaves the determinant unchanged, and you have a top row that is mostly $0$ except $-n(n-k+2)+k-1$ in the last entry.
Compute the determinant $D_n$ by expanding across this top row, and you have that $$\begin{align}
D_n&=(-1)^n(-n(n-n+2)+n-1)D_{n-1}/(n-n+2)\\
&=(-1)^n(-n-1)D_{n-1}/2\\
&=(-1)^n(-n-1)(-1)^{n-1}(-n(n-(n-1)+2)+n-1-1)D_{n-2}/[2(n-(n-1)+2)]\\
&=(-1)^{n+(n-1)}(-n-1)(-2n-2)D_{n-2}/[2(3)]\\
&=(-1)^{n+(n-1)}(-n-1)(-2n-2)(-1)^{n-2}(-n(n-(n-2)+2)+n-2-1)D_{n-3}/[2(3)(n-(n-2)+2)]\\
&=(-1)^{n+(n-1)+(n-2)}(-n-1)(-2n-2)(-3n-3)D_{n-3}/[2(3)(4)]\\
&\cdots\\
&=(-1)^{n+(n-1)+\cdots+2}(-n-1)(-2n-2)\cdots(-(n-1)n-(n-1))D_{1}/n!\\
&=(-1)^{n(n+1)/2-1}(n+1)(2n+2)\cdots((n-1)n+(n-1))(-n)/n!\\
&=(-1)^{n(n+1)/2}(n+1)^{n-1}(n-1)!(n)/n!\\
&=(-1)^{n(n+1)/2}(n+1)^{n-1}\\
\end{align}$$
A: 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.
A: An easier way to do that: 


*

*Step $1$: Add the $2$nd, $3$rd, $\ldots$, $n$th row to the first row to get
$$\begin{bmatrix}
-1 & -1 & \cdots & -1 & -1\\
1 & 1 & \cdots & -n & 1 \\
\vdots & \vdots & \ddots & \vdots & \vdots \\
1 & -n & \cdots & 1 & 1 \\
-n & 1 & \cdots & 1 & 1 \\
\end{bmatrix}$$

*Step $2$: Add the first row to the $2$nd, $\ldots$, $n$th row respectively to get:
$$\begin{bmatrix}
-1 & -1 & \cdots & -1 & -1\\
0 & 0 & \cdots & -n - 1 & 0 \\
\vdots & \vdots & \ddots & \vdots & \vdots \\
0 & -n - 1 & \cdots & 0 & 0 \\
-n - 1 & 0 & \cdots & 0 & 0 \\
\end{bmatrix}$$

*Step $3$: Expand the determinant along the $n$th column to get
$$\det(D_n) = (-1)^{1 + n}(-1)\det(B) = (-1)^{n + 2}\det(B),$$
where $B$ is the anti-diagonal matrix
$$\begin{bmatrix}
0 & 0 & \cdots & -n - 1 \\
\vdots & \vdots & \ddots & \vdots \\
0 & -n - 1 & \cdots & 0 \\
-n - 1 & 0 & \cdots & 0 \\
\end{bmatrix}$$
For any $m \times m$ anti-diagnoal matrix $D$
$$D = \begin{bmatrix}
0 &  \cdots & d \\
\vdots  & \ddots & \vdots \\
d &  \cdots & 0 \\
\end{bmatrix},$$
we have $$\det(D) = \begin{cases} 
(-1)^{m/2}d^m & d \text{ is even},\\
(-1)^{(m - 1)/2}d^m & d \text{ is odd}.
\end{cases}$$
Therefore,
\begin{align}
\det(D_n) = & (-1)^{n + 2}\begin{cases}
(-1)^{(n - 1)/2}(-n - 1)^{n - 1} & n - 1 \text{ is even}, \\
(-1)^{(n - 1 - 1)/2}(-n - 1)^{n - 1} & n - 1 \text{ is odd}.
\end{cases} \\
= & \begin{cases}
(-1)^{\frac{5n + 1}{2}}(n + 1)^{n - 1} & n \text{ is odd}, \\
(-1)^{\frac{5n}{2}}(n + 1)^{n - 1} & n \text{ is even}.
\end{cases} \\
\end{align}
A: Another solution, perhaps with an unusual method.
Let $T_m(x)$ the determinant of the $m\times m$ matrice, with entries $x$ on the antidiagonal, and $1$ otherwise. Clearly, your determinant $D_n$ is equal to $T_n(-n)$. The determinant $T_m(x)$ is a polynomial in $x$. The derivative of $T_m$ is obtained by differentiating the $k$-th column, computing the new determinant, and adding all these determinants. The computation of these determinant is easy: they are all equal to $(-1)^{m-1}T_{m-1}(x)$. Hence we get $T_m^{\prime}(x)=(-1)^{m-1}m T_{m-1}(x)$. In addition it is clear that $T_m(1)=0$. Put $S_m(x)=T_m(1+x)$. We get $S_m^{\prime}(x)=(-1)^{m-1}m S_{m-1}(x)$ and $S_m(0)=0$. We have $S_1(x)=1+x$, $S_2(x)=-2x-x^2$. An easy induction show that $S_m(x)=(-1)^{m(m-1)/2}(m x^{m-1}+x^m)$. Now to finish
$D_n=T_n(-n)=S_n(-n-1)$, and we are done.
