Consider a matrix where the diagonal entries are anything but the offdiagonal entries are all one. I was able to find a formula for the determinant of this matrix, but what are other known properties? Does this matrix have a name? In particular is there a formula for its inverse?

9$\begingroup$ It's the sum of a diagonal matrix and a rank one matrix, so the ShermanMorrison formua would give an explicit formula for the inverse. en.wikipedia.org/wiki/Sherman%E2%80%93Morrison_formula $\endgroup$ – Terry Tao Dec 23 '19 at 4:12

$\begingroup$ Never seen this before, so thank you! $\endgroup$ – cgmil Dec 23 '19 at 4:30

1$\begingroup$ @TerryTao: This matrix may have no inverses. $\endgroup$ – Mark Sapir Dec 23 '19 at 4:44

$\begingroup$ @MarkSapir That's certainly true; from the original formulation one can choose the diagonal entries to be one and then the matrix is clearly singular. If we're going to study the inverse we need to make more assumptions, but if there is an inverse it will have a certain form. (I used the Morrison formula to find that inverse.) Bonus points for other quantities such as eigenvalues/eigenvectors, though. $\endgroup$ – cgmil Dec 23 '19 at 4:47

$\begingroup$ @cgmil: The matrix can be invertible and the formula mat not give the inverse. For example matrix(2,1;1,1). $\endgroup$ – Mark Sapir Dec 23 '19 at 6:17
Such a matriix has the form $J +D,$ where $D$ is a diagonal matrix, and $J$ is a square matrix with all entries $1$. One small remark is that if $D$ has two of its diagonal entries equal to $\lambda$, then $\lambda$ is also an eigenvalue of $J+D$. This is because the $\lambda$eigenspace of $D$ is at least twodimensional and the $0$eigenspace of $J$ has codimension one.