Find the determinant when all entries are $1$ except for zeroes on the main diagonal Let $J_n$ be an $n\times n$ matrix all of whose entries are $1$, and $I_n$ be the identity matrix. Define $$K_n = J_n-I_n$$
For $n=1$ to $5$ my (usually unreliable!) hand calculations suggest that
$$\det K_n = (-1)^{n-1}(n-1)$$
Question 
(a) are these values correct?
(b) is the generalization to any positive integer $n$ valid?
(c) if (b) is true, how can the result be demonstrated?
My only idea so far is to use the product of eigenvalues: 
$$\det K_n = \prod_{j=1}^n \lambda_j$$
($-1$ is an eigenvalue for all $n$)
Any assistance much appreciated. 
(note: a similar question concerning skew-symmetric matrices Determinant of a special skew-symmetric matrix may contribute some relevant ideas. or perhaps Determinant of a matrix with $t$ in all off-diagonal entries. has greater relevance)
 A: Using the Weinstein-Aronszajn determinant identity,
$$\begin{array}{rl} \det \left( {\bf 1}_n {\bf 1}_n^\top - {\bf I}_n \right) &= \det \left( -\left( {\bf I}_n - {\bf 1}_n {\bf 1}_n^\top \right) \right)\\ &= (-1)^n \cdot \det \left( {\bf I}_n - {\bf 1}_n {\bf 1}_n^\top \right)\\ &= (-1)^n \cdot \det \left( 1 - {\bf 1}_n^\top {\bf 1}_n \right) \\ &= (-1)^n \cdot (1-n)\\ &= (-1)^{n-1} \cdot (n-1)\end{array}$$
A: This is the adjacency matrix of the complete graph $K_n$. The eigenvalues are $\lambda_1 = (n - 1)$ and $\lambda_2 = \dots = \lambda_n = -1$.
The eigenvector for $\lambda_1$ is the vector $\pmb{1}$ consisting of all $1$s.
An eigenbasis for $\lambda_2,\dots,\lambda_n$ is given by $e_1 - e_j$. Note that
$$ (J_n - I_n)(e_1 - e_n) = \pmb{1}\pmb{1}^T(e_1 - e_j) - (e_1 - e_j) = - (e_1 - e_j). $$
This is because $J_n = \pmb{1}\pmb{1}^T$ and $\pmb{1}^Te_i = 1$ for all basis vectors $e_i$.

The fact that $n - 1$ is an eigenvalue reflects the fact that $K_n$ is an $(n - 1)$-regular graph. There may also be a combinatorial interpretation for the other eigenvalues but I don't know enough algebraic graph theory to say.
A: Finding the eigenvalues of a matrix $A$ that has $a$ along its main diagonal and $b$ everywhere else comes up fairly often on this site, but I’ll repeat the calculation here. Write the matrix as $A=b\mathbb1+(a-b)I$, where $\mathbb 1$ is the $n\times n$ matrix with every entry equal to $1$. Suppose $v$ is an eigenvector of $A$. We then have $b\mathbb1v=(\lambda-a+b)v$, so $v$ is also an eigenvector of $b\mathbb1$. Moreover, the eigenvalues of this matrix and those of $A$ differ by $a-b$. Now, for $b\ne0$, $b\mathbb1$ has rank 1, so its eigenvalues are $0$ with multiplicity $n-1$ and, using the fact that the trace of a matrix is equal to the sum of its eigenvalues, $nb$ with multiplicity 1. (You could also find the non-zero eigenvalue by noticing that all of the row sums are identical.) This means that the eigenvalues of $A$ are $a+(n-1)b$ and $a-b$, giving $$\det A=(a+(n-1)b)(a-b)^{n-1}.$$ For your matrices, $a=0$ and $b=1$, so $\det{K_n}=(-1)^{n-1}(n-1)$, just as you’ve calculated.
