Art of Problem Solving

2025 AMC 10A Problems/Problem 24

Call a positive integer fair if no digit is used more than once, it has no $0$s, and no digit is adjacent to two greater digits. For example, $196, 23$ and $12463$ are fair, but $1546, 320,$ and $34321$ are not. How many fair positive integers are there?

$\textbf{(A) } 511 \qquad \textbf{(B) } 2584 \qquad \textbf{(C) } 9841 \qquad \textbf{(D) } 17711 \qquad \textbf{(E) } 19682$

Solution 1

Note that the condition that no digit is adjacent to two greater digits means that the digits must be in ascending order up to some largest digit, when they then switch to descending order. To find the number of such numbers, consider two "parts" of the number: the ascending part and the descending part. Note that since each of these has a unique ordering, we just need to divide the digits $1-9$ among these parts. For each such digit, it can either be in the ascending part, descending part, or not be in the number, giving $3$ possibilities per digit for a total of $3^9$ possibilities. However, we can see that the number cannot be "empty", so we have to subtract 1. Furthermore, the largest digit can be on either part, as it will not make a difference. For example, $136|742=1367|42.$ Therefore, we divide by $2$ to get $(3^9-1)/2=19682/2=\boxed{\textbf{(C) } 9841}$ ~krithikrokcs