Solution
= Solution
A power of a <diagonal matrix> acts entrywise. Thus
$$
\boxed{D^n=\operatorname{diag}((-1)^n,2^n,1).}
$$
From $A=BDB^{-1}$, adjacent $B^{-1}B$ factors cancel in repeated multiplication, giving
$$
\boxed{A^n=BD^nB^{-1}.}
$$
This is the <matrix power> rule for a <similarity transformation>, proved directly rather than by taking powers of separate noncommuting factors.