2. The number of five-digit numbers where the sum of any two adjacent digits is divisible by 3 is $\qquad$ .


2.1254.

Classify the digits by their remainders, then the five-digit number $\overline{a b c d e}$ that meets the condition satisfies
$$
a \equiv c=e \equiv 2(\bmod 3), b \equiv d \equiv 1(\bmod 3),
$$

or $a=c=e=1(\bmod 3), b=d=2(\bmod 3)$,
or $a=b=c=d=e=0(\bmod 3)$.
If it is equation (1), then there are $3^{5}$ such five-digit numbers. If it is equation (2), then there are $3^{5}$ such five-digit numbers. If it is equation (3), then there are $3 \times 4^{4}$ such five-digit numbers.
Therefore, the total number of five-digit numbers that meet the condition is
$$
3^{5}+3^{5}+3 \times 4^{4}=1254 \text { (numbers). }
$$