How many different orders can the digits $0,1,2,3,4,5,6$ form a seven-digit number divisible by four? (The number cannot start with 0.)
Solution. A number is divisible by 4 if the two-digit number formed by its last two digits is divisible by 4. It is useful to distinguish two cases based on whether there is a 0 among the last two digits or not.

If there is no 0, then the ending of the seven-digit number can be one of the following eight possibilities: $12,16,24,32,36,52,56,64$. The 0 cannot be at the beginning of the number, so it can be in four positions, and there are 4! possibilities for the arrangement of the remaining four digits. This gives $8 \cdot 4 \cdot 4$! possibilities.

If the 0 is in one of the last two positions, then the ending of the number can be one of the following: 04, 20, 40, 60. In each of the four cases, there are $5!=120$ possibilities for the arrangement of the remaining five digits, so in this case, we get $4 \cdot 5!=480$ sequences.

Thus, the total number of possibilities is $768+480=1248$.