TITLE: Find the determinant when all entries are $1$ except for zeroes on the main diagonal
QUESTION [5 upvotes]: 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)

REPLY [3 votes]: 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.