I have been given the following definition: Let $K$ be a field, $n \in \mathbb{N}$, and $V$ an $n$-dimensional $K$-vector space. Furthermore $\varphi$ is an Endomorphism of $V$, such that there is a basis $\mathcal{B} = (b_1,\ldots,b_n)$ of $V$ that consists of eigenvectors of $\varphi$. $\varphi$ is defined as follows: $$\varphi(b_i) = a_i b_i \,\text{for} \, (1 \leq i \leq n).$$
My first task was to determine the characteristic polynomial of $\varphi$ and the eigenvalues. I found that by determining the determinant of: $$X_\varphi = X_{M_\mathcal{B}^\mathcal{B}(\varphi)} = det(X\cdot E_n - M_\mathcal{B}^\mathcal{B}(\varphi))$$ where $M_\mathcal{B}^\mathcal{B}(\varphi)$ is the transformation matrix and $E_n$ is the identity matrix. I found out that the transformation matrix is: $$M_\mathcal{B}^\mathcal{B}(\varphi) = \left( \begin{array}{cccccc} a_1 & 0 & 0 & 0 & \cdots & 0 \\ 0 & a_2 & 0 & 0 & \cdots & 0 \\ 0 & 0 & a_3 & 0 & \cdots & 0 \\ \vdots & & \ddots & \ddots & \ddots & \vdots \\ 0 & & & 0 & a_{n-1} & 0 \\ 0 & 0 & \cdots & 0 & 0 & a_{n} \\ \end{array} \right) \in K^{n \times n}.$$ So in conclusion we want to determine the determinant of the following matrix: $$det(X\cdot E_n - M_\mathcal{B}^\mathcal{B}(\varphi)) = \left( \begin{array}{cccccc} x - a_1 & 0 & 0 & 0 & \cdots & 0 \\ 0 & x - a_2 & 0 & 0 & \cdots & 0 \\ 0 & 0 & x - a_3 & 0 & \cdots & 0 \\ \vdots & & \ddots & \ddots & \ddots & \vdots \\ 0 & & & 0 & x- a_{n-1} & 0 \\ 0 & 0 & \cdots & 0 & 0 & x- a_{n} \\ \end{array} \right) \in K^{n \times n}.$$ $$\Rightarrow det(X\cdot E_n - M_\mathcal{B}^\mathcal{B}(\varphi)) = \prod_{i=1}^n (x-a_i). $$ $$\Rightarrow \text{The eigenvalues of $\varphi$ are the $a_i$ for $(1 \leq i \leq n)$}$$ The next task is: What preconditions are required for the eigenvalues of $\varphi$ such that there is a base $\mathcal{C}$ of $V$ such that the matrix $M_\mathcal{C}^\mathcal{C}(\varphi)$ is an upper triangle matrix but not a diagonal matrix. For this task I need to find the condition and the base $\mathcal{C}$. Right now I don't have any ideas of what kind of conditions are required and how the base $\mathcal{C}$ may look.
Proof:
If the $a_i$ are all equal then the matrix is diagonal in any basis (why?).
If they are not, say $a_1\neq a_2$, then let $\mathcal{C}$ be equal to $\mathcal{B}$ except you replace $b_2$ by $b_1+b_2$. What is the matrix in the basis $\mathcal{C}$?
Hint: you need to write $\varphi(c_2)=\varphi(b_1+b_2)=a_1b_1+a_2b_2$ in terms of $c_1\,(=b_1)\,$ and $c_2\,(=b_1+b_2)$