Simplification of the sum of all 4-digit palindromic numbers I apologize for the simplicity of this question, if necessary.
I understand that the sum of all 4-digit palindromes is as follows:
$$\sum_{a=1}^{9}(\sum_{b=0}^{9}abba),$$
which can be further expanded upon such that:
\begin{equation}
    \begin{aligned}
\sum_{a=1}^{9}(\sum_{b=0}^{9}abba) &= \sum_{a=1}^{9}\sum_{b=0}^{9}(1001a + 110b) \\
                             &= \sum_{a=1}^{9}[10(1001a) + 110\sum_{b=0}^{9}b].
    \end{aligned}
\end{equation}
The last line of the equation is what's confusing me. Where does the $10$ come from in $10(1001a)$? 
I don't use double summation notation often, so I assume it has to do with moving the summation of $b$ inside the equation to make the triangular number formula more apparent, but WHY do we need the $10$? 
Thank you for any help.
 A: The $10$ comes from summing over $b$ from $0$ to $9$. That is,
$$\sum_{b=0}^9 1001 a = 10 (1001 a)$$ so 
$$ \sum_{a=1}^9 \sum_{b=0}^9 1001 a = \sum_{a=1}^9 10 (1001 a)$$
A: Edited to add: Robert Israel's edit has rendered my answer supererogatory, but here it is anyway:
You need to specify the variables in your double summation, because
$$\sum_{a=1}^{9}(\sum_{b=0}^{9}abba)$$
is not the same as
$$\sum_{b=1}^{9}(\sum_{a=0}^{9}abba)$$
You may think the variables are obvious, but this is actually the source of your confusion. We have
$$\sum_{b=0}^{9}1001a = 1001a\sum_{b=0}^{9}1 = 10(1001a)$$
because $1001a$ is independent of $b$.
A: The inner sum has an implicit index of $b$.  Making the index explicit yields
$$\sum_{a = 1}^{9}\sum_{b = 0}^{9} (1001a + 110b)$$
Since $1001a$ is a constant with respect to $b$, 
\begin{align*}
\sum_{a = 1}^{9}\left[\sum_{b = 0}^{9} (1001a + 110b)\right] &  = \sum_{a = 1}^{9}\left[\sum_{b = 0}^{9} 1001a + \sum_{b = 0}^{9} 110b\right]\\
& = \sum_{a = 1}^{9}\left[1001a\sum_{b = 0}^{9} 1 + 110\sum_{b = 0}^{9} b\right]\\
& = \sum_{a = 1}^{9}\left[1001a \cdot 10 + 110 \sum_{b = 0}^{9} b\right]
\end{align*}
The factor of $10$ comes from summing $1$ ten times, once for each integer from $0$ to $9$.
A: The 10 comes from the sum of all the palindromes in one digit. Since there are 10 palindromes for every thousand, that is where they come from.
For Example,
The Palindromes for 1000 is 1001 to 1991, so if we were to find the sum, we have to add all the ones, or multiply it by 10
