<s>[INST] Determinant of a special $n\times n$ matrix Compute the determinant of the nun matrix:
$$
\begin{pmatrix}
2 &  1  & \ldots & 1 \\
1  &  2 & \ldots & 1\\
\vdots & \vdots & \ddots & \vdots\\
1  &   1       &\ldots & 2
\end{pmatrix}
$$
For $n=2$, I have$$
\begin{pmatrix}
2 &  1   \\
1  &  2 
\end{pmatrix}
$$ 
Then $det = 3$.
For $n=3$, we have
$$
\begin{pmatrix}
2 &  1 & 1\\
1  &  2 & 1\\
1 & 1 & 2 \\
\end{pmatrix}
$$
Then $det = 4$.
For $n=4$ again we have
$$
\begin{pmatrix}
2 &  1  & 1 & 1 \\
1  &  2 & 1 & 1\\
1 & 1 & 2 & 1\\
1  &   1  & 1 & 2
\end{pmatrix}
$$
Then $det = 5$
How can I prove that the determinant of nun matrix is $n+1$.
 [/INST] Yet another way to do it:  note that the matrices in question are of the form $I + J$, where $J$ is the matrix every entry of which is $1$.  We have $J^2 = nJ$ by an easy calculation; thus the eigenvalues of $J$ are $0$ and $n$.  The eigenspace corresponding to $n$ is the one dimensional subspace spanned by the vector $v = (1, 1, ... , 1)^T$; since $\ker J$ consists of those vectors $w = (w_1, w_2, . . ., w_n)^T$ with $\sum_1^n w_i = 0$, the eigenspace corresponding to $0$ is of dimension $n - 1$; these observations imply the when $J$, being symmetric, is diagonalized one obtains a matrix with $n$ occurring at precisely one place on the diagonal, and zeroes everywhere else.  Thus we see that the multiplicity of $0$ as an eigenvalue is $n - 1$; that of $n$ is $1$.  Now use the fact that since $Jx = ax \Leftrightarrow (J + I)x = (a + 1)x$ to see that the eigenvalues of $I + J$ are $n + 1$, of multiplicity $1$, and $1$ of multiplicity $n - 1$.  Thus $\det (J + I)$, being the product of these eigenvalues, is $n + 1$.
Hope this helps.  Happy New Year,
and as always,
Fiat Lux!!!
</s>