I am given all eigenvalues of a matrix: $1$,$2$, and $4$ and I have to find the matrix that has these eigenvalues.
What I concluded so far is that every upper-triangular and lower-triangular matrix with these values at the diagonal can be the matrix I'm looking for, but I struggle to find a general rule that will give me every matrix with these eigenvalues.
This assumes you only want 3 by 3 matrices. If not the answer is a little bit more messy.
Let $D = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 4 \end{bmatrix}$.
Then the collection of matrices that satisfy your condition is $ADA^{-1}$ where $A$ is any invertible 3 by 3 matrix.