8. Given the set
$$
\begin{array}{c}
A_{k}=\left\{2^{k-1}+\sum_{i=0}^{k-2} a_{i} 2^{a_{i}+i} \mid a_{i} \in\{0,1\},\right. \\
i=0,1, \cdots, k-2\} .
\end{array}
$$

Let $n_{k}$ denote the sum of all elements in the set $A_{k}$. Then $\sum_{k=1}^{2015} n_{k}=$ $\qquad$
8. $\frac{2^{4031}+1}{3}-2^{2015}$.

From binary, we know that regardless of how $a_{i}$ is chosen, the elements in the set $A_{k}$ are all distinct.
Considering that $a_{i}$ can take values of $0$ or $1$, when $a_{i}=1$,
$$
2^{a_{i}+i}=2^{i+1}(i=0,1, \cdots, k-2)
$$

appears $2^{k-2}$ times, then
$$
\begin{array}{l}
n_{k}=2^{k-1} \times 2^{k-1}+2^{k-2}\left(2^{k-1}+2^{k-2}+\cdots+2\right) \\
=2^{2 k-1}-2^{k-1} . \\
\text { Therefore, } \sum_{k=1}^{2015} n_{k}=\sum_{k=1}^{2015}\left(2^{2 k-1}-2^{k-1}\right) \\
=\frac{2^{4031}+1}{3}-2^{2015} .
\end{array}
$$