We proceed by induction on
\(k\text{.}\) For
\(k=1\text{,}\) the result is trivial as there is a walk of length
\(1\) from
\(v_i\) to
\(v_j\) if and only if they are adjacent.
Now, for
\(k\geq2\text{,}\) the
\((i,j)\) entry of
\(A_G^k\) is the sum over all
\(1\leq \ell\leq n\) of the
\((i,\ell)\) entry of
\(A_G^{k-1}\) multiplied by the
\((\ell,j)\) entry of
\(A_G\text{.}\) Thus, by induction, the
\(\ell\)th term counts the number of walks of length
\(k-1\) from
\(v_i\) to
\(v_\ell\) times the number of walks of length
\(1\) from
\(v_\ell\) to
\(v_j\text{.}\) That is, it counts walks of length
\(k\) from
\(v_i\) to
\(v_j\) in which the penultimate vertex is
\(v_\ell\text{.}\) Therefore, the sum of this quantity over all
\(\ell\) counts all walks of length
\(k\) from
\(v_i\) to
\(v_j\) and we are done.