# Prove that the following determinant equals $0$

We have a $$n\times n$$ matrix $$A=(a_{i,j})$$.
If $$i=j$$, then $$a_{i,j}=1-n$$. otherwise, $$a_{i,j}=1$$. Show that $$|A|=0$$.
I tried using gauss elimination but it just gets too complicated. I also tried to do $$R_i \rightarrow R_i-R_1/(1-n)$$ for all $$i>1$$, and then expand over the first column, but it also didn't work for me. Can someone please help?

• The matrix of all ones is often denoted $\mathbf J$. Your problem concerns $\mathbf J - n\mathbf I$, and it has been discussed in several previous Questions. – hardmath Jan 15 '19 at 15:40

Hint:$$A\left(\begin{array}{c}1\\1\\\vdots\\1\end{array}\right)=0.$$