2.1. Petya writes on the board such different three-digit natural numbers that each of them is divisible by 3, and the first two digits differ by 2. What is the maximum number of such numbers he can write if they end in 6 or 7?
Answer: 9

Solution. A number is divisible by 3 if the sum of its digits is a multiple of 3. If the number ends in 6, then the sum of the other two digits leaves a remainder of 0 when divided by 3. Such numbers are: 2,4 and 4,2; 5,7 and 7,5. If the number ends in 7, then the sum of the other two digits leaves a remainder of 2 when divided by 3. Such numbers are: 2,0; 3,5 and 5,3; 6,8 and 8,6. In total, there are 9 numbers: 246, 426, 576, 756, 207, 357, 537, 687, 867.