For $n \geq 2$, find the determinant of $A_{n}=\begin{bmatrix} n & 1 & 1 &\ldots &1 \\ 1 & n & 1 &\ldots &1 \\ 1 & 1 & n &\ldots &1 \\ \vdots & \vdots &\vdots & \ddots & \vdots\\ 1 & 1 & 1 &\ldots & n \end{bmatrix}_{n \times n} $
One can deduce the determinant of $A_{n}=(n-1)^{n-1}(2n-1)$ by taking $n=2,3,4...$. I solve it as follows but I found it is not elegant. Any better approach?
Here is my attempt:
Let's find the eigenvalues of $A_{n}$ by solving $det(\lambda I-A_{n})=0$ because $det(A_{n})=\lambda_{1}\lambda_{2}...\lambda_{n}$ where $\lambda_{i}$ are eigenvalues of $A_{n}$. Express $A_{n}=(n-1)I+J$ where $I$ is the n-by-n identity matrix while $J$ is an n-by-n matrix with all entries equal to 1. Denote $B=(n-1)I$ so that $$\lambda I-A_{n}=\lambda I-(B+J)=(\lambda I - B)(I-(\lambda I - B)^{-1}J)$$ Since $det(XY)=det(X)det(Y)$ for square matrices $X$ and $Y$ $$det(\lambda I-A_{n})=det(\lambda I - B)det(I-(\lambda I - B)^{-1}J)$$ Since $det(kX)=k^{n}det(X)$ for a scalar k and $det(I)=1$ $$det(\lambda I-B)=\det(\lambda I - (n-1)I)=(\lambda-(n-1))^{n}det(I)=(\lambda-(n-1))^{n}$$ If $u$ be a column vector of one's in $\mathbb{R}^{n}$, then $uu^{T}=J$ so that: $$det(I-(\lambda I - B)^{-1}J)=det(I-(\lambda I - B)^{-1}uu^{T}) $$ By Sylvester's Determinant Theorem: \begin{equation*} \begin{split} det(I-(\lambda I - B)^{-1}J)&=&det(I-(\lambda I - B)^{-1}uu^{T})=det(I-u^{T}(\lambda I - B)^{-1}u)\\ &=&1-u^{T}(\lambda I - B)^{-1}u=1-u^{T}(\lambda-(n-1))^{-1}Iu\\ &=&1-(\lambda-(n-1))^{-1}u^{T}Iu\\ &=&1-\frac{u^{T}u}{\lambda-(n-1)}=1-\frac{n}{\lambda-(n-1)}\\ &=&\frac{\lambda-(2n-1)}{\lambda-(n-1)} \end{split} \end{equation*} This yields $$det(\lambda I-A_{n})=(\lambda-(n-1))^{n}\frac{\lambda-(2n-1)}{\lambda-(n-1)}=(\lambda-(n-1))^{n-1}(\lambda -(2n-1))=0$$ The eigenvalues of $A_{n}$ are $n-1$ (with algebraic multiplicity of $n-1$) and $2n-1$ (with algebraic multiplicity of 1). Thus, $det(A_{n}=(n-1)^{n-1}(2n-1)$
I wonder if it is possible to obtain the determinant without solving for the eigenvalues. Or at least without using the Sylvester's determinant theorem....