Problem:
An integer is called snakelike if its decimal representation satisfies if is odd and if is even. How many snakelike integers between and have four distinct digits?
Solution:
To find the number of snakelike numbers that have four different digits, distinguish two cases, depending on whether or not is among the chosen digits. For the case where is not among the chosen digits, first consider only the digits , and . There are exactly snakelike numbers with these digits: , and . There are ways to choose four non-zero digits and five ways to arrange each such set for a total of numbers. In the other case, there are ways to choose three digits to go with , and three ways to arrange each set of four digits, because the snakelike numbers with the digits , and would correspond to the list above, but with the first two entries deleted. There are such numbers. Thus there are four-digit snakelike numbers with distinct digits.
The problems on this page are the property of the MAA's American Mathematics Competitions