This is LaTeX code:

[latex]
\displaystyle $\begin{align*}
D_n & = \left| \begin{array}{rrrrrrr}
0 & 1 & 1 & \ldots & 1 & 1 & 1 \\
-1 & 0 & 1 & \ldots & 1 & 1 & 1 \\
-1 & -1 & 0 & \ldots & 1 & 1 & 1 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\
-1 & -1 & -1 & \ldots & 0 & 1 & 1 \\
-1 & -1 & -1 & \ldots & -1 & 0 & 1 \\
-1 & -1 & -1 & \ldots & -1 & -1 & 0 \\
\end{array} \right| \stackrel{(1)}{=} \left| \begin{array}{rrrrrrr}
0 & 1 & 1 & \ldots & 1 & 1 & 1 \\
-1 & -1 & 0 & \ldots & 0 & 0 & 0 \\
-1 & -2 & -1 & \ldots & 0 & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\
-1 & -2 & -2 & \ldots & -1 & 0 & 0 \\
-1 & -2 & -2 & \ldots & -2 & -1 & 0 \\
-1 & -1 & -1 & \ldots & -1 & -1 & 0 \\
\end{array} \right| \\
& \stackrel{(2)}{=}
(-1)^{n + 1} \left| \begin{array}{rrrrrrr}
-1 & -1 & 0 & \ldots & 0 & 0 & 0 \\
-1 & -2 & -1 & \ldots & 0 & 0 & 0 \\
-1 & -2 & -2 & \ldots & 0 & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\
-1 & -2 & -2 & \ldots & -2 & -1 & 0 \\
-1 & -2 & -2 & \ldots & -2 & -2 & -1 \\
-1 & -1 & -1 & \ldots & -1 & -1 & -1 \\
\end{array} \right| \\
& \stackrel{(3)}{=}
(-1)^{n + 1} \left| \begin{array}{crrrrrr}
\frac{-1 + (-1)^{n - 1}}{2} & 0 & 0 & \ldots & 0 & 0 & 0 \\
\frac{-1 + (-1)^{n - 2}}{2} & -1 & 0 & \ldots & 0 & 0 & 0 \\
\frac{-1 + (-1)^{n - 3}}{2} & -1 & -1 & \ldots & 0 & 0 & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots & \vdots \\
-1 & -1 & -1 & \ldots & -1 & 0 & 0 \\
0 & -1 & -1 & \ldots & -1 & -1 & 0 \\
-1 & -1 & -1 & \ldots & -1 & -1 & -1 \\
\end{array} \right| \\
& = (-1)^{n + 1} \cdot \frac{-1 + (-1)^{n - 1}}{2} \cdot (-1)^{n - 2} = \frac{1 + (-1)^{n}}{2} \end{align*}
[/latex]