Find cofactor matrix of a certain matrix I'm studying for a qualifying exam in Linear algebra, and I came across this problem:
Compute the cofactor matrix of the $n\times n$ matrix $A$ whose elements are $-1$ off-diagonal and $n-1$ on the main diagonal. What can you conclude about the invertibility of $A$?
For example, if $n=3$ then $A=
\begin{bmatrix}
2&-1 &-1 \\
-1 & 2 & -1 \\
-1 & -1 & 2\\
\end{bmatrix}$
Through some numerical exploration, I think the cofactor matrix will be $n^{n-2}J_n$, where $J_n$ is the $n \times n$ all-ones matrix. From here, it is easy to conclude that $A$ will not be invertible, because it's adjugate will be a singular matrix.
But I'm having trouble finding the cofactor matrix itself. How do I show that each cofactor will be $n^{n-2}$? Any help is appreciated.
 A: There is a way to link this to spectral graph theory. This is the laplacian of the complete graph $K_3$.
The cofactor matrix of a laplacian matrix has all of its entries equal to each other, its entries are equal to the number of spanning trees of the graph, which in this case would be $3$. This result is sometimes known as Kirchoff's theorem.
There is another way to see this matrix is not invertible, all of its rows have sum $0$, so the vector consisting only of ones is in the kernel.
A: 1.) Note that $A=nI- \mathbf {11}^T$ has eigenvalue of 0 with multiplicity one and $n$ with muliplicity $n-1$. This means $\text{rank}\big(A\big)=n-1$.  (I tacitly assume/ infer you're working over $\mathbb R$.)
2.) Using the above approach, you can can easily compute the diagonals of the adjugate (compute the spectra of the leading $n-1 \times n-1$ principal submatrix).  They are constant and equal to $\gamma$.
3.) There's various ways to finish.  Using the rank one update formula (Sherman-Morrison) for inverses consider the form of the adjugate for the  sequence  $B_k := \big(nI -(1-\frac{1}{k})\mathbf {11}^T)\big)$.  Without any computation you can see the off diagonals of the adjugate are all equal to one another for any given $k$ and therefore they are in the limit (= the adjugate of A). Thus the adjugate is of the form $\beta I + \alpha \mathbf{11}^T$ and it has rank one (why?) which implies $\beta =0$ and $\alpha = \gamma$.
