Later data often show patterns better than early data, so extend your table of partial sums a bit:
$$\begin{array}{rcc}
n:&1&2&3&4&5&6&7&8&9\\
s_n:&1&-1&3&-5&11&-21&43&-85&171
\end{array}$$
Ignoring the signs, it appears that the numbers in the bottom line are approximately doubling each time. Moreover, still ignoring signs, adjacent partial sums add up to a power of $2$: $|s_1|+|s_2|=2^1$, $|s_2|+|s_3|=2^2$, $|s_3|+|s_4|=2^3$, and apparently in general $|s_n|+|s_{n+1}|=2^n$. (If you go back to the definition of the partial sums, you’ll see why this happens.)
If $|s_n|+|s_{n+1}|=2^n$ and $|s_{n+1}|\approx 2|s_n|$, then $3|s_n|\approx 2^n$; this suggests that we should compare $3|s_n|$ with $2^n$:
$$\begin{array}{rcc}
n:&1&2&3&4&5&6&7&8&9\\
s_n:&1&-1&3&-5&11&-21&43&-85&171\\
3|s_n|:&3&3&9&15&33&63&129&255&513\\
2^n:&2&4&8&16&32&64&128&256&512
\end{array}$$
That pattern’s pretty clear: apparently $3|s_n|=2^n+1$ if $n$ is odd, and $3|s_n|=2^n-1$ if $n$ is even. Those cases can be combined as $3|s_n|=2^n+(-1)^{n+1}$, since $(-1)^{n+1}$ is $1$ when $n$ is odd and $-1$ when $n$ is even. And the algebraic sign of $s_n$ appears to be that of $(-1)^{n+1}$, so if these patterns are real,
$$\begin{align*}
s_n&=\frac{(-1)^{n+1}}3\left(2^n+(-1)^{n+1}\right)\\
&=\frac{(-1)^{n+1}2^n}3+\frac{(-1)^{2n+2}}3\\
&=\frac{(-1)^{n+1}2^n+1}3\\
&=\frac{1-(-2)^n}3\;.
\end{align*}$$
This result can then be proved by mathematical induction, but I suspect that you’re not expected to go that far.
If you’ve already learned the summation formula for finite geometric series, you can apply it to get $s_n$ without looking at any patterns at all, and it’s something that you should learn as soon as possible if you don’t already know it. However, skill at pattern-recognition is useful anyway, so I thought that it might be useful to see how the problem can be attacked in that way as well.
Best Answer
You can get $a_n$ by writing $n$ in binary and interpreting it as a base $3$ number. For example, to get $a_{21}$ we note that $21=10101_2$ so $a_{21}=3^4+3^2+3^0=91_{10}$ One way to express this is $$a_n=\sum_{i=0}^\infty3^i\frac {n \bmod {2^{i+1}}}{2^{i}}$$ where we are using integer division. The fraction picks out whether the $i^{th}$ bit in the binary representation of $n$ is a $1$.