6. Let $n=\sum_{a_{1}=0}^{2} \sum_{a_{2}=0}^{a_{1}} \cdots \sum_{a_{2} 012=0}^{a_{2} 011}\left(\prod_{i=1}^{2012} a_{i}\right)$. Then the remainder when $n$ is divided by 1000 is . $\qquad$
6. 191 .

It is evident that from $a_{1}$ to $a_{2012}$ forms a non-increasing sequence, and the maximum element does not exceed 2. Therefore, their product is a power of 2 or 0. Since each power of 2 can only be represented in one way (the sequence being non-increasing), we have
$$
\begin{array}{l}
n=1+2+4+\cdots+2^{2012} \\
=2^{2013}-1 \equiv 191(\bmod 1000) .
\end{array}
$$