The sequence $a_1$, $a_2$, $a_3,$ $\dots$ is defined by $a_1 = 1,$ $a_2 = 3,$ and
a_n = 2a_{n - 1} + a_{n - 2}.
Thus, the next few terms are $a_3 = 2a_2 + a_2 = 6 + 1 = 7$ and $a_4 = 2a_3 + a_2 = 14 + 3 = 17$.
Find the remainder when $a_8$ is divided by $3.$