Let $$ B = \begin{bmatrix} a & 1 & & & \\ & \ddots & \ddots & \\ & & \ddots & 1 \\ & & & a \end{bmatrix} \qquad\text{and}\qquad A = \begin{bmatrix} a & & & \\ 1 & \ddots & & \\ & \ddots & \ddots & \\ & & 1 & a \end{bmatrix}. $$ I need to prove they are similar. I was thinking using the characteristic polynomial which is as definition $p(A) = t^n - t(\operatorname{tr}A) + \det A$ and $p(B) = t^n - t(\operatorname{tr}A) + \det B$ and then both have the same trace and same determinant so their characteristic polynomial is the same so they are similar to the same matrix and hence similar to each other?
Yet I came across another solution suggesting $A ,B$ are both same transformation matrices for different bases of $\mathbb R^n$. So I’m not sure if my solution is ok.