返回题库

AIME 2017 II · 第 4 题

AIME 2017 II — Problem 4

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

Find the number of positive integers less than or equal to 20172017 whose base-three representation contains no digit equal to 00.

解析

Solution

Solution 1

The base-33 representation of 2017102017_{10} is 220220132202201_3. Because any 77-digit base-33 number that starts with 2222 and has no digit equal to 00 must be greater than 2017102017_{10}, all 77-digit numbers that have no digit equal to 00 must start with 2121 or 11 in base 33. Of the base-33 numbers that have no digit equal to 00, there are 252^5 77-digit numbers that start with 2121, 262^6 77-digit numbers that start with 11, 262^6 66-digit numbers, 252^5 55-digit numbers, 242^4 44-digit numbers, 232^3 33-digit numbers, 222^2 22-digit numbers, and 212^1 11-digit numbers. Summing these up, we find that the answer is 25+26+26+25+24+23+22+21=2222^5+2^6+2^6+2^5+2^4+2^3+2^2+2^1=\boxed{222}.

Solution 2

Note that 2017=220220132017=2202201_{3}, and 2187=37=1000000032187=3^7=10000000_{3}. There can be a 1,2,...,71,2,...,7 digit number less than 21872187, and each digit can either be 11 or 22. So 212^1 one digit numbers and so on up to 272^7 77 digit.

Now we have to subtract out numbers from 20182018 to 21872187

Then either the number must begin 221...221... or 222...222... with four more digits at the end

Using 11s and 22s there are 242^4 options for each so:

2+4+8+16+32+64+128216=256232=2222+4+8+16+32+64+128-2*16=256-2-32=\boxed{222}

Solution 3 (Casework)

Since the greatest power of 33 that can be used is 363^6, we can do these cases.

Coefficient of 36=03^6=0: Then if the number has only 303^0, it has 2 choices (1 or 2). Likewise if the number has both a 313^1 and 303^0 term, there are 4 choices, and so on until 353^5, so the sum is 2+4+...+64=1271=1262+4+...+64=127-1=126.

Coefficient of 36=13^6=1: Any combination of 11 or 22 for the remaining coefficients works, so 26=642^6=64. Why is this less than 126126? Because the first time around, leading zeroes didn't count. But this time, all coefficients 3n3^n of n<6n<6 need 1 and 2.

Coefficient of 36=23^6=2: Look at 353^5 coefficient. If 1, all of them work because 37=218735=243<<20173^7=2187-3^5=243<<2017. That's 32 cases. Now of this coefficient is 2, then at the coefficient of 34=813^4=81 is at least 1. However, 362+352+34>>20173^6*2+3^5*2+3^4>>2017, so our answer is 126+64+32=222126+64+32=\boxed{222}.