Determinant of a specific circulant matrix, $A_n$ Let
$$A_2 = \left[ \begin{array}{cc} 0 & 1\\ 1 & 0 \end{array}\right]$$
$$A_3 = \left[ \begin{array}{ccc} 0 & 1 & 1\\ 1 & 0 & 1 \\ 1 & 1 & 0 \end{array}\right]$$
$$A_4 = \left[ \begin{array}{cccc} 0 & 1 & 1 & 1\\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0\end{array}\right]$$
and so on for $A_n$.
I was asked to calculate the determinant for $A_1, A_2, A_3, A_4$ and then guess about the determinant for $A_n$ in general. Of course the pattern is clear that
$$ \det A_n = (n-1)(-1)^{n-1} $$
but I was wondering as to what the proof of this is. I tried to be clever with cofactor expansions but I couldn't get anywhere.
Could someone explain it to me please?

Here is an elementary way to compute the determinant of $A_n$:
Add row 2 to row 1, add row 3 to row 1, ..., and add row $n$ to row 1, we get
$$\det(A_n)=\begin{vmatrix}
      n-1 & n-1 & n-1 & \cdots & n-1 \\
      1 & 0 & 1 &\cdots & 1 \\
     1 & 1 & 0 &\cdots & 1 \\
      \vdots & \vdots & \vdots  & \ddots & \vdots \\
      1 & 1 & 1 & \ldots & 0 \\
    \end{vmatrix}.$$
Next subtract column 2 by column 1, subtract column 3 by column 1, ..., subtract column $n$ by column 1, we get
$$\det(A_n)=\begin{vmatrix}
      n-1 & 0 & 0 & \cdots & 0 \\
      1 & -1 & 0 &\cdots & 0 \\
     1 & 0 & -1 &\cdots & 0 \\
      \vdots & \vdots & \vdots  & \ddots & \vdots \\
      1 & 0 & 0 & \ldots & -1 \\
    \end{vmatrix}=(-1)^{n-1}(n-1).$$
