I am looking at branching processes in Dobrow 2016 (p. 160), where the author states that the "mean of the offspring distribution" is $\mu =\sum_{k=0}^{\infty} k a_k$. I want to know why the following equation holds:
$$\sum_{k=0}^{\infty} \mathbb{E} \Big( \sum_{i=1}^k X_i \Big) = \sum_{k=0}^{\infty} k \Big( \sum_{k=0}^{\infty} k a_k \Big).$$
How is this result obtained?