How many arrangements of the numbers satisfy a divisibility condition? How many ways can one arrange the numbers 21,31,41,51,61,71,81 such that sum of every 4 consecutive numbers is divisible by 3 ?
 A: Looking at the remainders of the numbers when dividing by 3, the set $\{21,31,41,51,61,71,81\}$ becomes $\{0,1,2,0,1,2,0\}$. The only way four consecutive numbers from the set $\{0,1,2,0,1,2,0\}$ will be divisible by three is if the four numbers are $0,1,2,0$.
The only ordering of the original set that has $0,1,2,0$ in the four possible consecutive positions is of the form $$\{S\},0,\{S\}$$ where $\{S\}$ represents the values $0,1,2$ in any order (but the same order for both occurrences).
Counting possibilities, in the left-hand set $\{S\}$, we can choose any of the three $0$, any of the two $1$ and any of the two $2$, for 12 possible ways to make the specific order $\{0,1,2\}$. We can make 6 permutations of $\{0,1,2\}$ for a total of 72 possibilities for the left-hand set $S$.
Now for the right-hand set $\{S\}$, we have two $0$ remaining to choose from, one $1$ and one $2$, for two possibilities. This leaves the one remaining $0$ for the middle.
Therefore, we have a total of 72 possibilities on the left and 2 possibilities on the right, for $\boxed{144}$ possibilities in all.
A: If we look at the remainders after dividing by $3$, we have three $0$'s, two $1$'s, and two $2$'s. If the first four numbers add to a multiple of three, when we look at the second through fifth numbers we are dropping the first and adding the fifth. That means that the first and fifth numbers must have the same remainder, and similarly for the second and sixth, and the third and seventh.
So the remainders must come in pairs. The only remainder that did not come in pairs is $0$, so the fourth number in the sequence, the only one not paired, must have remainder $0$. So the first three numbers must add to a multiple of three, as well as the last three numbers.
We then see with our available choices that the only way to get the first three numbers to add to a multiple of three is if they have the remainders $0,1,2$ in any order.
So here is how we get all suitable sequences.


*

*Choose a number with remainder $0$ (after division by three) for the fourth number. This is $3$ possible choices.

*Choose any of the remaining available numbers to be the first number. This has $6$ possible choices since one was used in the previous step. Then the fifth number must be the other number with the same remainder, only $1$ choice here. So we had a total of $6\cdot 1=6$ choices here.

*Choose any of the remaining available numbers to be the second number. This has $4$ possible choices since three were used in the previous steps. Then the sixth number must be the other number with the same remainder, only $1$ choice here. So we had a total of $4\cdot 1=4$ choices here.

*Choose any of the remaining available numbers to be the third number. This has $2$ possible choices since five were used in the previous steps. Then the seventh number must be the other number with the same remainder, only $1$ choice here. So we had a total of $2\cdot 1=2$ choices here.


We are now done. The total number of possible choices was $3\cdot 6\cdot 4\cdot 2=144$.
A: In the following, all arithmetic will be done $\mod 3$.
Note that mod $3$, these numbers are $0,1,2,0,1,2,0$.  The sum of all seven is $0$.   Any sum of four leaves out three, which must sum to $0$.  The only (unordered) possibilities for those three are $(0,0,0)$ and $(0,1,2)$.
Now in your arrangement, it must be possible to leave out the first three, the first two and last one, the first one and last two, and the last three.
Since the first three sum to $0$, and the last three sum to $0$, the middle
term must be $0$.  This leaves two other $0$'s.  The first three can't be $(0,0,0)$, so they must be $(0,1,2)$ in some order, and similarly the last three. If the first three are $(x,y,z)$,  and the last three are $(x',y',z')$, in addition to $x+y+z=0$ and $x'+y'+z'=0$ 
we must have $x+y+z' = 0$ and $x+y'+z'=0$, so $z'=z$, $y'=y$, $x'=x$.
Any of the six permutations of $(0,1,2)$ are possible for the first three, 
and then the same permutation for the last three.
Now in terms of the original numbers, each of these six orderings of $0,1,2,0,1,2,0$ corresponds to $3!\; 2!\; 2!$ arrangements (i.e. the three $0$'s can be any permutation of $21,51,81$, the two $1$'s can be ....).
So the final result is  $6 \; 3!\; 2!\; 2! = 144$.
