2007 AIME II Problem 6

Below is the professionally curated solution for Problem 6 of the 2007 AIME II, from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2007 AIME II solutions, or check the answer key.

All of the real AMC 8, AMC 10, AMC 12, and AIME problems in our complete solution collection are used with official legal permission of the Mathematical Association of America (MAA).

Concepts:digitsparitymultiplication principle

Difficulty rating: 2390

6.

An integer is called parity-monotonic if its decimal representation a1a2a3aka_1 a_2 a_3 \ldots a_k satisfies ai<ai+1a_i \lt a_{i+1} if aia_i is odd, and ai>ai+1a_i \gt a_{i+1} if aia_i is even. How many four-digit parity-monotonic integers are there?

Solution:

A digit aia_i may immediately precede ai+1=da_{i+1} = d exactly when aia_i is odd and less than d,d, or even and greater than d.d. Checking each dd from 00 to 9,9, this always allows exactly 44 digits: for example, d=0d = 0 allows 2,4,6,8;2, 4, 6, 8; d=4d = 4 allows 1,3,6,8;1, 3, 6, 8; d=9d = 9 allows 1,3,5,7.1, 3, 5, 7. (Raising dd by 11 trades odd choices for even ones, keeping the total at 4.4.) Note that 00 is never an allowed predecessor, since 00 is even but exceeds no digit.

So choose the last digit a4a_4 in 1010 ways, then each of a3,a_3, a2,a_2, a1a_1 in 44 ways; the leading digit is automatically nonzero. The count is 4310=640.4^3 \cdot 10 = 640.

← Problem 5Full ExamProblem 7

Problem 6 in Other Years