How to determine the rank and determinant of $A$? let $A$ be $$A_{a} = \begin{pmatrix} a & 1 & 1 & 1 \\ 1 & a & 1 & 1\\ 1 & 1 & a & 1\\ 1 & 1 & 1 & a \end{pmatrix}$$
How can I calculate the rank of $A$ by the Gauss' methode and $\det A$?

We know that this matrix is equivalent to $$B=\begin{pmatrix}a&0&0&1-a\\1&a-1&0&0\\1&1-a&a-1&0\\1&0&1-a&a-1\end{pmatrix}$$
and $$\det(B)=a(a-1)^3-(1-a)((1-a)^2-(a-1)((1-a)-(a-1))=(a-3)(a-1)^3$$ and $\text{rank}(A)=4$ for all values of $a$ except $1$ and $3$.
