返回题库

AIME 2007 II · 第 6 题

AIME 2007 II — Problem 6

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

An integer is called parity-monotonic if its decimal representation a1a2a3aka_{1}a_{2}a_{3}\cdots a_{k} satisfies aiifa_{i} ifa_{i}isodd,andis odd, anda_{i}>a_{i+1}ififa_{i}$ is even. How many four-digit parity-monotonic integers are there?

解析

Solution 1

Let's set up a table of values. Notice that 0 and 9 both cannot appear as any of a1, a2, a3a_1,\ a_2,\ a_3 because of the given conditions. (Also note that 0 cannot appear as 0 cannot be the first digit of an integer.) A clear pattern emerges.

For example, for 33 in the second column, we note that 33 is less than 4,6,84,6,8, but greater than 11, so there are four possible places to align 33 as the second digit.

Digit

1st

2nd

3rd

4th

0

0

0

0

64

1

1

4

16

64

2

1

4

16

64

3

1

4

16

64

4

1

4

16

64

5

1

4

16

64

6

1

4

16

64

7

1

4

16

64

8

1

4

16

64

9

0

0

0

64

For any number from 1-8, there are exactly 4 numbers from 1-8 that are odd and less than the number or that are even and greater than the number (the same will happen for 0 and 9 in the last column). Thus, the answer is 4k110=4310=6404^{k-1} \cdot 10 = 4^3\cdot10 = 640. -yeetdayeet

Solution 2: Recursion

This problem can be solved via recursion since we are "building a string" of numbers with some condition. We want to create a new string by adding a new digit at the front so we avoid complications(00 can't be at the front and no digit is greater than 99). There are 44 options to add no matter what(try some examples if you want) so the recursion is Sn=4Sn1S_n=4S_{n-1} where SnS_n stands for the number of such numbers with nn digits. Since S1=10S_1=10 the answer is 640\boxed{640}.