Permutations of seven numbers such that none of the sums are divisible by 3 How many permutations $(a_1,\dots, a_7)$ of $(2,3,4,5,6,7,8)$ exist such that none of the sums
$a_1$,
$a_1+a_2$,
...
$a_1+a_2+\dots a_7$
are divisible by $3$?
I tried to study the cases of the possible $3$-remainders for members of such permutations, but I found that there are just too many possibilities. I hope there is some simple idea that I just can't see.
 A: Studying remainders has to be the place to start. So we have $2$ numbers divisible by three (=remainder $0$), $2$ numbers with remainder $1$ and $3$ numbers with remainder $2$. 
The remainder-$0$ numbers can be inserted at any point within or after a sequence of the other numbers that otherwise qualifies; they will not there "break" a qualifying sequence and will not "fix" a non-qualifying sequence.
So we can focus on the other $5$ numbers first: 


*

*If we start with a rem $1$ number, another $1$ must follow but then we have only rem $2$ numbers left, and we cannot avoid a running total divisible by $3$.

*If we start with a rem-$2$ number, another $2$ must follow, then $1$ and $2$ to avoid $6$, finally $1$.
So only a remainder sequence matching  $22121$ is suitable.  We have $3!=6$ options for placing the remainder-$2$ numbers, $2!=2$ for the rem-$1$s. Then we can insert the rem-$0$ numbers in $\binom 62 = 15$ patterns and $2$ orders.
So we have $3!\cdot 2! \cdot \binom 62 \cdot 2 =360$ options.
A: We can't start with a number that is congruent $0 \mod 3$.  so we must start with one that is congruent $\pm 1 \mod 3$.  If we start $1 \mod 3$ we can't have a $-1 \mod 0$ before we have the second $1\mod 3$.  If we start with a $1 \mod 3$ then have some zeros modulo three, another $1 \mod 3$ we will have no more $1\mod 3$s, so we will have to have, at some point, two $-1 \mod 3$s which will add to $0$.
So the first number must be congruent $-1 \mod 3$, then we must have another $-1 \mod 3$ before we have a $1 \mod 3$.  After the two $-1 \mod 3$s we can't have a third $-1\mod 3$ until we have a $1 \mod 3$.  Once we have two $-1 \mod 3$s and one $1\mod 3$ we must have the third $-1 \mod 3$ before the second $1\mod 3$.
So the order must be $-1\mod 3, *, -1\mod 3, *, 1 \mod 3, *, -1\mod 3, *, 1 \mod 3, * $, where $*$ are zero or more $0\mod 3$.  So of the six remaining places, the two $0\mod 3$ can go anywhere.
So there are ${6 \choose 2}$ ways to arrange $(-1\mod 3,0\mod 3,1\mod 3,-1\mod 3,0\mod 3,1\mod 3,-1\mod 3,0\mod 3)$.
$2,5,8 \equiv -1 \mod 3$ and there are $3!$ ways to order those.  $2!$ ways to order $4,7 \equiv 1 \mod 3$ and $2!$ ways to order $3,6\equiv 0 \mod 3$.
So there are ${6 \choose 2}3!*2!*2! = \frac {6!}{4!2!}*6*2*2 = \frac{5*6}26*2*2 =5*6*6*2 =360$ ways to do this.
