The inverse and det of $n \times n$ matrix $A=(a_{ij})$, with $a_{ii}=2i+1, a_{ij}=i+j, i\neq j$. The inverse and det of $n \times n$ matrix $A=(a_{ij})$, with $a_{ii}=2i+1, a_{ij}=i+j, i\neq j$.
How to do? Clearly, let $e=(1,\cdots,1)^T, \alpha=(1,2,\cdots,n)^T$, then $A=I_n+e\alpha^T+\alpha e^T$. It seems quite hard to use the famous Shermann-Morrison formula:
$(A+\alpha \beta^T)^{-1}=A^{-1}-\frac{A^{-1}\alpha \beta^T A^{-1}}{1+\beta^T A^{-1}\alpha}$
 A: A folk theorem, known as Sylvester determinant theorem, states that $\det(I+XY)=\det(I+YX)$. (Don't confuse it with Sylvester determinant identity, which is a very different identity.) In your case,
$$
\det(A)
=\det\left(I_n+\pmatrix{e&\alpha}\pmatrix{\alpha^T\\ e^T}\right)
=\det\left(I_2+\pmatrix{\alpha^T\\ e^T}\pmatrix{e&\alpha}\right).
$$
To find $A^{-1}$, consider a generic case first. Let $X=\pmatrix{u&v}$ be an $n\times2$ matrix whose elements are $2n$ independent indeterminates and let $Y=\pmatrix{v^T\\ u^T}$. Since there are examples of $u,v\in\mathbb C^n$ such that $XY$ and $YX$ are diagonalisable over $\mathbb C$, the two products are diagonalisable (over an appropriate field) when $u$ and $v$ are two vectors of indeterminates. Therefore $A=I_n+XY$ is similar to
$$
B=\pmatrix{I_2+YX&0\\ 0&I_{n-2}}.
$$
Let $t=\operatorname{tr}(I_2+YX)$ and $d=\det(I_2+YX)\,(=\det(A))$. Then
$$
(x^2-tx+d)(x-1)
=x^3-(t+1)x^2+(d+t)x-d
$$
is an annihilating polynomial of $B$ and $A$. Hence
$$
A^{-1}=\frac{1}{d}\left(A^2-(t+1)A+(d+t)I_n\right).
$$
Since this is true when $u$ and $v$ are vectors of indeterminates, it is also true when $u,v$ are numeric vectors and $d\ne0$.
