Question 4
There exist $r$ unique nonnegative integers $n_1 \gt n_2 \gt \cdots \gt n_r$ and $r$ unique integers $a_k$ $(1 \le k \le r)$ with each $a_k$ either $1$ or $-1$ such that $$
\begin{aligned} &a_1 3^{n_1} + a_2 3^{n_2} + \cdots + a_r 3^{n_r} \\ &= 2008. \end{aligned}
$$ Find $n_1 + n_2 + \cdots + n_r.$
\begin{aligned} &a_1 3^{n_1} + a_2 3^{n_2} + \cdots + a_r 3^{n_r} \\ &= 2008. \end{aligned}
$$ Find $n_1 + n_2 + \cdots + n_r.$