Determinant and inverse matrix calculation of a special matrix Is there any smart way of calculating the determinant of this kind matrix?
\begin{pmatrix}
1 & 2 & 3 & \cdots &  n \\
2 & 1 & 2 & \cdots & n-1 \\ 
3 & 2 & 1 & \cdots & n-2 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
n & n-1 & n-2 & \cdots & 1 \end{pmatrix}
I encountered this in a problem for the case $n=4$. I need to find the inverse matrix.
I doubt the idea of this problem is to calculate all the cofactors and then the inverse matrix in the usual way.
I see the pattern here and some recursive relations... but I am not sure if this helps for calculating the determinant of the existing matrix.

Call your matrix $A$. Let $\{e_1,e_2,\ldots,e_{n-1}\}$ be the standard basis of $\mathbb R^{n-1}$. Let also $e=\sum_ie_i=(1,1,\ldots,1)^T$ and
$$
L=\pmatrix{1\\ -1&1\\ &\ddots&\ddots\\ &&-1&1}.
$$
Then $B:=LAL^T=\pmatrix{1&e^T\\ e&-2I_{n-1}}$. Using Schur complement, we obtain
$$
\det(A)=\det(B)=\det(-2I_{n-1})\left(1-e^T(-2I_{n-1})^{-1}e\right)=(-2)^{n-1}\frac{n+1}{2}.
$$
To find $A^{-1}$, partition $L$ as $\pmatrix{1&0\\ -e_1&L'}$. Then
\begin{aligned}
A^{-1}
&=L^TB^{-1}L\\
&=\pmatrix{1&-e_1^T\\ 0&L'^T}
\pmatrix{\frac{2}{n+1}&\frac{1}{n+1}e^T\\ \frac{1}{n+1}e&\frac{1}{2(n+1)}ee^T-\frac12I_{n-1}}
\pmatrix{1&0\\ -e_1&L'}\\
&=\pmatrix{\frac{1}{n+1}&\frac{1}{2(n+1)}e^T+\frac12e_1^T\\ \ast&\frac{1}{2(n+1)}e_ne^T-\frac12L'^T}
\pmatrix{1&0\\ -e_1&L'}\\
&=\pmatrix{\frac{-n}{2(n+1)}&\frac{1}{2(n+1)}e_n^T+\frac12e_1^T\\ \ast&\frac{1}{2(n+1)}e_ne_n^T-\frac12L'^TL'}.
\end{aligned}
By direct calculation, $L'^TL'$ is the symmetric tridiagonal matrix whose main diagonal is $(2,\ldots,2,1)$ and whose superdiagonal is a vector of $-1$s. Since $A^{-1}$ is symmetric, we finally get
$$
A^{-1}=\pmatrix{
\frac{-n}{2(n+1)}&\frac12&&&\frac{1}{2(n+1)}\\
\frac12&-1&\frac12\\
&\frac12&-1&\ddots\\
&&\ddots&\ddots&\frac12\\
\frac{1}{2(n+1)}&&&\frac12&\frac{-n}{2(n+1)}
}.
$$
