TITLE: how many ways of arranging given 7 two digit positive integers so that the sum of every four consecutive integer is divisible by 3?
QUESTION [5 upvotes]: in how many ways can I arrange the numbers: 21,31,41,51,61,71,81 such that the sum of every four consecutive numbers is divisible by three?

Though I am not an expert on modulo math, I do know that if we were to take MOD 3 on all of the numbers in the list, I would get the following in respective order:
$0_{21}, 1_{31}, 2_{41}, 0_{51}, 1_{61}, 2_{71}, 0_{81}$ (the subscript correlates to what original number it represents) and clearly if we were to match the values so that the sum is a multiple of three, the numbers added up would also be a multiple of three.
But upon realizing that the numbers must be consecutive and that if taking any four consecutive numbers in a set of 7 terms, I got stuck here and do not know how to proceed.

REPLY [3 votes]: If you want the sums $a_1+a_2+a_3+a_4$ and $a_2+a_3+a_4+a_5$ to both be multiples of $3$, then you must have $a_1\equiv a_5$ mod $3$. Similarly $a_2\equiv a_6$, $a_3\equiv a_7$. 
This means that you need to pair these numbers off in pairs which are equal mod $3$, and the other one, $a_4$, must be $0$ mod $3$ (because there are three numbers which are $0$ mod $3$).
So your sequence, mod $3$, must be one of the following:

$0,1,2,0,0,1,2$
$0,2,1,0,0,2,1$
$1,0,2,0,1,0,2$
$1,2,0,0,1,2,0$
$2,0,1,0,2,0,1$
$2,1,0,0,2,1,0$.

All of these work. Once you've chosen one of these sequences you can fill it in by replacing the $0$s with $21,51,81$ in some order, the $1$s with $31,61$ in some order, and the $2$s with $41,71$ in some order. There are therefore $6\times6\times2\times2=144$ ways to do this in total.