3. How many nine-digit numbers written using nine different digits 1, 2, 3, 4, 5, 6, 7, 8, 9 are there such that each three-digit number formed by three consecutive digits of that number is divisible by 3?
First solution.

The digits 1, 4, and 7 give a remainder of 1 when divided by 3.

The digits 2, 5, and 8 give a remainder of 2 when divided by 3.

The digits 3, 6, and 9 give a remainder of 0 when divided by 3.

1 POINT

A three-digit number is divisible by 3 if and only if its digits

- all give the same remainder when divided by 3, or
- all give different remainders when divided by 3.

If, for example, the first three digits of the desired nine-digit number all give the same remainder when divided by 3, then the fourth digit would also have to give the same remainder when divided by 3, which is not possible.

Therefore, the remainders that the digits of the desired number give when divided by 3 form a sequence:

$$
a b c a b c a b c \text{, }
$$

where $a, b$, and $c$ are distinct elements of the set $\{0,1,2\}$.

2 POINTS

The remainders 0, 1, and 2 can form the sequence $a b c$ in $3 \cdot 2 \cdot 1=6$ ways.

1 POINT

The digits that give a remainder of $a$ can be permuted in 6 ways.

1 POINT

The digits that give a remainder of $b$ can be permuted in 6 ways.

1 POINT

The digits that give a remainder of $c$ can be permuted in 6 ways.

1 POINT

Thus, the number of numbers that satisfy the conditions of the problem is $6 \cdot 6 \cdot 6 \cdot 6=6^{4}=1296$.

3 POINTS

TOTAL 10 POINTS

Note: If a student, for example, does not account for the number of ways the sequence 012 can be permuted and gets the result $6 \cdot 6 \cdot 6=6^{3}$ or has the result $3 \cdot 3 \cdot 3 \cdot 3=3^{4}$ (or makes a similar mistake but knows that the obtained numbers should be multiplied), they should receive 2 out of the last 3 POINTS.