Determinant of a matrix that is almost lower triangular Calculate the determinant of
$$ \left[
\begin{array}{cccc}
1 & 0 & 0 & 0  & \cdots & 1\\
1 & a_1 & 0 & 0  &  \cdots & 0 \\
1 & 1 & a_2 & 0  &  \cdots & 0 \\
1 & 0 & 1 & a_3  &  \cdots & 0 \\
\vdots & \vdots & \vdots & \vdots & \ddots & \vdots  \\ 
1 & 0 & 0  & \cdots& 1 & a_{n-1} \\
\end{array}
\right]$$
I tried to develop at the first line, but got stuck. Any helps or hints appreciated.
 A: Expanding from the first one will force a product along the leading diagonal; the one at the end of the first row will leave you with another determinant
\begin{eqnarray*}
\left[
\begin{array}{cccc}
1 & 0 & 0 & 0  & \cdots & 1\\
1 & a_1 & 0 & 0  &  \cdots & 0 \\
1 & 1 & a_2 & 0  &  \cdots & 0 \\
1 & 0 & 1 & a_3  &  \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \ddots & \vdots  \\ 
1 & 0 & 0  & \cdots& 1 & a_{n-1} \\
\end{array}
\right]=a_1 \cdots a_{n-1}+(-1)^{n+1}\left[
\begin{array}{cccc}
1 & a_1 & 0 & 0  &  \cdots & 0 \\
1 & 1 & a_2 & 0  &  \cdots & 0 \\
1 & 0 & 1 & a_3  &  \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \ddots & \vdots  \\ 
1 & 0 & 0  & \cdots& 1 & a_{n-2} \\
1 & 0 & 0  & \cdots& 0 & 1 \\
\end{array}
\right]
\end{eqnarray*}
Now take the last row of this determinant & make it the first row & shift all the other rows down by one; this will introduce another $(-1)^{n+1}$ but will be essentially the same determinant that you started with but of size one smaller
\begin{eqnarray*}
-(-1)^{n+1}(-1)^{n+1}\left[
\begin{array}{cccc}
1 & 0 & 0 & 0  & \cdots & 1\\
1 & a_1 & 0 & 0  &  \cdots & 0 \\
1 & 1 & a_2 & 0  &  \cdots & 0 \\
1 & 0 & 1 & a_3  &  \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \ddots & \vdots  \\ 
1 & 0 & 0  & \cdots& 1 & a_{n-2} \\
\end{array}
\right]
\end{eqnarray*}
So now we can use the above arguement recursively & we have
\begin{eqnarray*}
D=a_1 \cdots a_{n-1}-a_1 \cdots a_{n-2} +\cdots (-1)^{n-2}a_1+ (-1)^{n-1}.
\end{eqnarray*}
Tidy this expression up a little bit & we have the answer (exactly as Arden states in his comment)
\begin{eqnarray*}
D=\sum_{k=0}^{n-1}(-1)^{n-1-k}\prod_{i=1}^ka_i.
\end{eqnarray*}
