# Non-diagonal matrix with eigenvalues equal to its diagonal entries [duplicate]

Is it possible to construct a matrix with non-zero off-diagonal entries whose eigenvalues are nonetheless equal to its diagonal entries?

EDIT: @ajotataxe pointed out that this holds for triangular matrices. My follow up is - is the converse true? If the Eigen values are the diagonals, does it have to be triangular?

## marked as duplicate by Jean Marie, erfink, Shailesh, Daniel W. Farlow, LeucippusMay 24 '17 at 1:24

• Do you mean "non-zero entries off its diagonals"? (Otherwise the question is kind of trivial.) – Kenny Wong May 23 '17 at 17:28
• Yes, non-zero entries off its diagonals. – Rohit Pandey May 23 '17 at 17:29
• A triangular matrix? – ajotatxe May 23 '17 at 17:42
• Right, triangular is true.. Thanks! Is it only possible for triangular? Let me edit the question. – Rohit Pandey May 23 '17 at 17:49
• What would be truly surprising is a symmetric real matrix that is not diagonal and whose eigenvalues are on the diagonal. – Giuseppe Negro May 23 '17 at 17:55

Yes:$$\begin{pmatrix}0&\frac12&\frac12\\1&1&1\\1&-1&-1\end{pmatrix}.$$Its eigenvalues are $0$, $1$ and $-1$.
• I started with the matrix $\left(\begin{smallmatrix}0&a&b\\c&1&d\\e&f&-1\end{smallmatrix}\right)$. Its characteristic polynomial is $-x^3+a c x+b e x+d f x+x+a c-b e+a d e+b c f$. So, I searched for numbers $a$, $b$, $c$, $d$, $e$, and $f$ such that $ac+be+de=0$ and that $a c - b e + a d e + b c f=0$. In order to do that, I solved the system in order to $a$ and $b$ and then I chose more or less random values for $c$, $d$, $e$, and $f$. – José Carlos Santos May 23 '17 at 18:22