**AMC 10 Mock Exam Question 18**

How many nonnegative integers can be written in the form $$a_7\cdot 3^7+a_6\cdot 3^6+a_5\cdot 3^5+a_4\cdot 3^4+a_3\cdot 3^3+a_2\cdot 3^2+a_1\cdot 3^1+a_0\cdot 3^0,$$ where $a_i\in \{-1,0,1\}$ for $0\leq i \leq 7$?

$\displaystyle \textbf{(A) } 512 \qquad \textbf{(B) } 729 \qquad \textbf{(C) } 1094 \qquad \textbf{(D) } 3281 \qquad \textbf{(E) } 59,048$

Submit your answer and solution and explanation below! Solutions will be accepted for 48 hours until 9/19 at 2pm Pacific Time. (There's still time for yesterday's problem too: click here.)

Top solutions for all the Mock Exam questions will be collected and shared as part of a full 25 Question Mock AMC 10 Exam.

Note: The question above is a past AMC problem. Solutions submitted must be written by students. Copied solutions will be disqualified.