TITLE: How to find the sum of all entries in the matrix $A^5$
QUESTION [5 upvotes]: Let $A$ be a $4 × 4$ matrix with non-negative entries such that the sum of the entries in each row of $A$ equals $1$. Find the sum of all entries in the matrix $A^5$.

If $A=I_4$ then $A^5=I_4$ and sum of all entries in the matrix $A^5=4$. But how I show the general result. Please help.

REPLY [13 votes]: Let $j=\left(\begin{matrix}1\\\vdots\\1\end{matrix}\right)$. Then  the sum of entries of matrix $A^5$ is just $j^TA^5j$. What can you say about $Aj$?