TITLE: If $A^n = B$ and I know $B$, can I find $A$?
QUESTION [6 upvotes]: Suppose that $A$ and $B$ are invertible, $p \times p$ matrices. If $A^n = B$ and I know all of the entries in $B$, can I find an $A$ for some or all integers $n \ge 0$? How many solutions for $A$ exist? If I'm thinking correctly, then $A = B * (A^{-1})^{n-1},$ but this is sort of self referential. Thanks!

REPLY [2 votes]: We can use diagonalisation of $B$ to constract a solution of this equation, that mean if $B=PDP^{-1}$ and we suppose that $D=Diag(\lambda_1,\lambda_2,\dots,\lambda_k)$ if you put $A=PRP^{-1}$ where 
$$
R=Diag(\sqrt[n]{\lambda_1},\sqrt[n]{\lambda_2},\dots,\sqrt[n]{\lambda_k})
$$
So you can verify that $A^n=B$