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
Problem 520
Official solution
4. C First, consider how many pairs of numbers in the set have a difference of .
Obviously, there are 16 pairs: . Except for , 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 56 in total.
Therefore, the total number of numbers that meet the requirement is .
Hence, the answer is C.