# Sum of the entries in the matrix $A^3$

Let $A\neq I$ be a $5\times5$ matrix with real entries such that the sum of the entries in each row of $A$ is $1$. Then the sum of all the entries in $A^3$ is

1)$\space 3$ $\qquad$2)$\space 15$ $\qquad$ 3)$\space 5$ $\qquad$ 4)$\space 125$

Solution:

The answer is $5$ if $A = I$, but for $A \neq I$,

I found that vectors $\begin{pmatrix} 1\\ 1\\ 1\\ 1\\ 1\\ \end{pmatrix}$ and $\begin{pmatrix} -1\\ -1\\ -1\\ -1\\ -1\\ \end{pmatrix}$ are eigen vectors for the matrix $A$ corresponding to eigen value $1$. From here, I dont know how to proceed, please help me solve the question..and if there are mistakes in my argument, please tell me..

Let $e$ be the all one vector.
As you pointed out, we have $Ae=e$
The sum of all the entries in $A^3$ is
$$e^TA^3e=e^TA^2(Ae)=e^TA^2e=e^TAe=e^Te=n$$
where $n$ is equal to 5 for this particular question.