Olympiad Maths Prep

Track / Stage 4 / 260 of 340 #520 of 2000

Problem 520

AMC 12 late, AIME early
Combinatorics Difficulty 5.0 Find the answer

4. Among the integers between 1000 and 9999, the number of four-digit integers with all different digits, where the absolute difference between the first and last digit is 2, is
A. 672
B. 784
C. 840
D. 896

Official solution

4. C First, consider how many pairs of numbers in the set {0,1,,9}\{0,1, \cdots, 9\} have a difference of ±2\pm 2.

Obviously, there are 16 pairs: (0,2),(2,0),(1,3),(3,1),(2,4),(4,2),,(7,9),(9,7)(0,2),(2,0),(1,3),(3,1),(2,4),(4,2), \cdots,(7,9),(9,7). Except for (0,2)(0,2), all of these can be used to form the required number.

Since the requirement is that the digits of the four-digit number must all be different, the possible scenarios for the middle two digits are 87=8 \cdot 7= 56 in total.
Therefore, the total number of numbers that meet the requirement is 1556=84015 \cdot 56=840.
Hence, the answer is C.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.