TITLE: How to calculate this determinant?
QUESTION [12 upvotes]: How to calculate this determinant?

$$A=\begin{bmatrix}n-1&k&k&k&\ldots& k\\k&n-1&k&k&\ldots &k\\\ldots&\ldots&\ldots &&\ldots\\\\k&k&k&k&\ldots &n-1\\
\end{bmatrix}_{n\times n}$$

where $n,k\in \Bbb N$ are fixed.
I tried for $n=3$ and got the characteristic polynomial as $(x-2-k)^2(x-2+2k).$
How to find it for general $n\in \Bbb N$?

REPLY [3 votes]: Here is another method using only rows and columns manipulations. Less smart than previous answers but less demanding in prior knowledge.
First let's replace the first column by the sum of all colums:
$$\begin{bmatrix}n-1&k&\ldots& k\\k&n-1&\ldots &k\\\ldots&\ldots&\ldots &\ldots\\\\k&k&\ldots &n-1\\
\end{bmatrix} =
\left(n-1 + (n-1) \cdot k \right)\begin{bmatrix}1&k&k&\ldots &k\\
1&n-1&k&\ldots &k\\
\ldots&\ldots&\ldots &\ldots&\ldots\\
\\1&k&k&\ldots &n-1\\
\end{bmatrix}
$$
Now let's subtract the first row from all the other ones. It remains:
$$ 
 (n-1)  (k+1)\begin{bmatrix}1&k&k&\ldots &k\\
0&n-1-k&0&\ldots &0\\
\ldots&\ldots&\ldots &\ldots&\ldots\\
\\0&0&0&\ldots &n-1-k\\
\end{bmatrix} = (n-1)  (k+1) (n-1-k)^{n-1}
$$