第 654 题:(2008 AIME II, 4)
There exist $r$ unique nonnegative integers $n_1 > n_2 > \cdots > n_r$ and $r$ integers $a_k$ ($1\le k\le r$) with each $a_k$ either $1$ or $- 1$ such that \[ a_13^{n_1} + a_23^{n_2} + \cdots + a_r3^{n_r} = 2008. \] Find $n_1 + n_2 + \cdots + n_r$.
- Write $2008$ in base $3$ with digits $-1,0,1$ (balanced ternary): repeatedly take the remainder mod $3$, replacing a remainder $2$ by $-1$ (and carrying $1$).
- $2008=3\cdot669+1$, $669=3\cdot223$, $223=3\cdot74+1$, $74=3\cdot25-1$, $25=3\cdot8+1$, $8=3\cdot3-1$, $3=3\cdot1$, $1$. So $2008=3^7-3^5+3^4-3^3+3^2+3^0$.
- The exponents add to $7+5+4+3+2+0=21$. The answer is $\boxed{021}$.
There exist $r$ unique nonnegative integers $n_1 > n_2 > \cdots > n_r$ and $r$ integers $a_k$ ($1\le k\le r$) with each $a_k$ either $1$ or $- 1$ such that \[ a_13^{n_1} + a_23^{n_2} + \cdots + a_r3^{n_r} = 2025. \] Find $n_1 + n_2 + \cdots + n_r$.