<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] Let $$v=(1,1,1,1...1)^T$$
Your matrix is $$
I + v v^T$$
This has $n-1$ eigenvalues equal to $1$ and one with value $n+1$. Hence the result.
</s>