$A^3$ is similar to $B^3$ but $A^2$ is not similar to $B^2$ Find an example of $A,B$ such that $A^3$ is similar to $B^3$, and $A^2$ is not similar to $B^2$, and $A$ is not similar to $B$.
I only have some clues that $p_{A^2}(x) \neq p_{B^2}(x)$ and $p_{A}(x) \neq p_{B}(x)$
I first wanted to start from $A^3 = S^{-1} B^3 S$
Then let $S$ and $B$ to be some arbitrary matrices, where $S$ is invertiable, so that I could obtain $A^3$ which is similar to $B^3$. Thus, $A = \sqrt[\leftroot{-3}\uproot{3}3]{A^3}$
However, I realize I don't know how to find square root or cube root of matrices.

Let $\omega:=e^{\frac{2\pi i}{3}}$.
Then
$$
A=\begin{pmatrix}
\omega & 0\\
0 &\omega
\end{pmatrix}
\text{  and  }
B=\begin{pmatrix}
\omega & 0\\
0 &1\\
\end{pmatrix}
$$
will do the trick.
