返回题库

AIME 2004 II · 第 14 题

AIME 2004 II — Problem 14

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

Consider a string of nn 77's, 777777,7777\cdots77, into which ++ signs are inserted to produce an arithmetic expression. For example, 7+77+777+7+7=8757+77+777+7+7=875 could be obtained from eight 77's in this way. For how many values of nn is it possible to insert ++ signs so that the resulting expression has value 70007000?

解析

Solution 1

Suppose we require aa 77s, bb 7777s, and cc 777777s to sum up to 70007000 (a,b,c0a,b,c \ge 0). Then 7a+77b+777c=70007a + 77b + 777c = 7000, or dividing by 77, a+11b+111c=1000a + 11b + 111c = 1000. Then the question is asking for the number of values of n=a+2b+3cn = a + 2b + 3c.

Manipulating our equation, we have a+2b+3c=n=10009(b+12c)09(b+12c)<1000a + 2b + 3c = n = 1000 - 9(b + 12c) \Longrightarrow 0 \le 9(b+12c) < 1000. Thus the number of potential values of nn is the number of multiples of 99 from 00 to 10001000, or 112112.

However, we forgot to consider the condition that a0a \ge 0. For a solution set (b,c):n=10009(b+12c)(b,c): n=1000-9(b+12c), it is possible that a=n2b3c<0a = n-2b-3c < 0 (for example, suppose we counted the solution set (b,c)=(1,9)n=19(b,c) = (1,9) \Longrightarrow n = 19, but substituting into our original equation we find that a=10a = -10, so it is invalid). In particular, this invalidates the values of nn for which their only expressions in terms of (b,c)(b,c) fall into the inequality 9b+108c<1000<11b+111c9b + 108c < 1000 < 11b + 111c.

For 1000n=9k9(712+11)=8551000 - n = 9k \le 9(7 \cdot 12 + 11) = 855, we can express kk in terms of (b,c):nb(mod12),0b11(b,c): n \equiv b \pmod{12}, 0 \le b \le 11 and c=nb127c = \frac{n-b}{12} \le 7 (in other words, we take the greatest possible value of cc, and then "fill in" the remainder by incrementing bb). Then 11b+111c855+2b+3c855+2(11)+3(7)=898<100011b + 111c \le 855 + 2b + 3c \le 855 + 2(11) + 3(7) = 898 < 1000, so these values work.

Similarily, for 8559k9(812+10)=954855 \le 9k \le 9(8 \cdot 12 + 10) = 954, we can let (b,c)=(k812,8)(b,c) = (k-8 \cdot 12,8), and the inequality 11b+111c954+2b+3c954+2(10)+3(8)=998<100011b + 111c \le 954 + 2b + 3c \le 954 + 2(10) + 3(8) = 998 < 1000. However, for 9k963n379k \ge 963 \Longrightarrow n \le 37, we can no longer apply this approach.

So we now have to examine the numbers on an individual basis. For 9k=9729k = 972, (b,c)=(0,9)(b,c) = (0,9) works. For 9k=963,981,990,999n=37,19,10,19k = 963, 981, 990, 999 \Longrightarrow n = 37, 19, 10, 1, we find (using that respectively, b=11,9,10,11+12pb = 11,9,10,11 + 12p for integers pp) that their is no way to satisfy the inequality 11b+111c<100011b + 111c < 1000.

Thus, the answer is 1124=108112 - 4 = \boxed{108}.


A note: Above, we formulated the solution in a forward manner (the last four paragraphs are devoted to showing that all the solutions we found worked except for the four cases pointed out; in a contest setting, we wouldn't need to be nearly as rigorous). A more natural manner of attacking the problem is to think of the process in reverse, namely seeing that n1(mod9)n \equiv 1 \pmod{9}, and noting that small values of nn would not work.

Looking at the number 70007000, we obviously see the maximum number of 7s7's: a string of 1000 7s1000 \ 7's. Then, we see that the minimum is 28 7s: 7779+7=700028 \ 7's: \ 777*9 + 7 = 7000. The next step is to see by what interval the value of nn increases. Since 777777 is 3 7s, 7710+73 \ 7's, \ 77*10 + 7 is 21 7s21 \ 7's, we can convert a 777777 into 77s77's and 7s7's and add 1818 to the value of nn. Since we have 9 777s9 \ 777's to work with, this gives us 28,46,64,82,100,118,136,154,172,190(=28+18n1n9)28,46,64,82,100,118,136,154,172,190 ( = 28 + 18n | 1\leq n\leq 9) as values for nn. Since 7777 can be converted into 7117*11, we can add 99 to nn by converting 7777 into 7s7's. Our n=190n = 190, which has 0 777s 90 77s 107s0 \ 777's \ 90 \ 77's \ 10 7's. We therefore can add 99 to n 90n \ 90 times by doing this. All values of nn not covered by this can be dealt with with the n=46 (8 777s 10 77s 2 7s)n = 46 \ (8 \ 777's \ 10 \ 77's \ 2 \ 7's) up to 190190.

Solution 2

To simplify, replace all the 77’s with 11’s. Because the sum is congruent to n(mod9)n \pmod 9 and

10001(mod9)    n1(mod9)1000 \equiv 1 \pmod 9 \implies n \equiv 1 \pmod 9 Also, n1000n \leq 1000. There are 10009+1=112\big\lfloor \tfrac{1000}{9} \big\rfloor + 1 = 112 positive integers that satisfy both conditions i.e. {1,10,19,28,37,46,...,1000}.\{1, 10, 19, 28, 37, 46, . . . , 1000\}.

For n=1,10,19n = 1, 10, 19, the greatest sum that is less than or equal to 10001000 is

6111+1=667    1123=109.6 \cdot 111 + 1 = 667 \implies 112-3 = 109. Thus n28n \geq 28 and let S={28,37,46,...,1000}S = \{28, 37, 46, . . . , 1000\}.

Note that n=28n=28 is possible because 9111+11=10009 \cdot 111+1 \cdot 1 = 1000.

When n=37n = 37, the greatest sum that is at most 10001000 is 8111+611+11=9558 \cdot 111+6\cdot 11+1 \cdot 1 = 955.

All other elements of SS are possible because if any element nn of SS between 4646 and 991991 is possible, then (n+9)(n+ 9) must be too.

Case 1:\textbf{Case 1:} Sum has no 1111's

It must have at least one 11. If it has exactly one 11, there must be nine 111111’s and n=28n = 28. Thus, for n46n \geq 46, the sum has more than one 11, so it must have at least 10008111=1121000 - 8 \cdot 111 = 112 number of 11’s. For n1000n \leq 1000, at least one 111111. To show that if nn is possible, then (n+9)(n + 9) is possible, replace a 111111 with 1+1+11 + 1 + 1, replace eleven (1+1)(1 + 1)’s with eleven 1111’s, and include nine new 11’s as +1+1’s. The sum remains 10001000.

Case 2:\textbf{Case 2:} Sum has at least one 1111.

Replace an 1111 with 1+11 + 1, and include nine new 11’s as +1+1’s. Now note that 4646 is possible because 8111+1011+21=10008 \cdot 111 + 10 \cdot 11 + 2 \cdot 1 = 1000. Thus all elements of SS except 3737 are possible.

Thus there are 108\boxed{108} possible values for nn.

~phoenixfire

Solution 3

It's obvious that we cannot have any number 7777\ge 7777 because 7777>70007777 > 7000 so the max number that an occur is 777777

Let's say we have aa 777's , bb 77's and cc 7's

From here we get our required equation as 777a+77b+7c=7000777a + 77b + 7c = 7000

Now comes the main problem , one might think that if we find number of (a,b,c)(a,b,c) then we're done , but in reality we are over-counting our number of nn's. This is because nn is the total number of 7's and from our equation we'll get nn as 3a+2b+c3a + 2b + c (because there are three 7's , two 7's and one 7)

The reason why we're over-counting is because , say a1,b1,c1a_1 , b_1 , c_1 be a solution of our original equation and a2,b2,c2a_2 , b_2 , c_2 be another solution of our original equation , then there can be a possibility that 3a1+2b1+c1=3a2+2b2+c23a_1 + 2b_1 + c_1 = 3a_2 + 2b_2 + c_2 where a1a2,b1b2,c1c2a_1 \neq a_2 , b_1 \neq b_2 , c_1 \neq c_2 (example : 2+3+4=1+5+32 + 3 + 4 = 1 + 5 + 3 but 21,35,432 \neq 1 , 3 \neq 5 , 4 \neq 3

We know that 0a90 \le a \le 9 , 0b900 \le b \le 90 , 0c10000 \le c \le 1000 The bound on aa is easier to handle with , so lets start putting values on aa and calculate b,c,nb , c , n by making cases

Reduced equation : 111a+11b+c=1000111a + 11b + c = 1000

Case 1 : a=9a = 9

We get 11b+c=1    b=0,c=111b + c = 1 \implies b = 0 , c = 1 is our only solution thus only 1\boxed{1} value of nn

Case 2 : a=8a = 8

We get 11b+c=112    b=0,1,2,,1011b + c = 112 \implies b = 0,1,2,\cdots ,10 and c=112,101,90,,2c = 112 , 101 , 90,\cdots ,2 From here we get different nn's as 24+112,24+103,24+94,,24+2224 + 112 , 24 + 103 , 24 + 94, \cdots ,24 + 22 (remember n=3a+2b+cn = 3a + 2b + c and if you have difficulty in understanding how we got n=24+()n = 24 + (\cdots) then just put the values of a,b,ca,b,c i am sure you will get it :) )

Let's write the sequences of nn's in a compact form , Tp=24+22+9(p1)T_p = 24 + 22 + 9(p-1) (This will be helpful later on) There are 11\boxed{11} values of nn

Case 3 : a=7a = 7

We get 11b+c=223    b=0,1,2,,2011b + c = 223 \implies b=0,1,2, \cdots ,20 and c=223,212,201,,3c = 223,212,201, \cdots ,3 From here we get different nn's as 21+223,21+214,21+205,,21+4321 + 223, 21 + 214 , 21 + 205, \cdots ,21 + 43

Let's also write the sequences of nn's in a compact form , Tq=21+43+9(q1)T_q = 21 + 43 + 9(q-1)

Now comes the major part , since we need to find distinct nn's so let's subtract the cases where we find common values , from the total number of values.

To do this we need to make Tp=Tq    pq=2T_p = T_q \implies p - q = 2 (after some calculations you'll get pq=2p - q = 2) . Now we know that 0p100 \le p \le 10 and 0q200 \le q \le 20 so we get pp as 10,9,,210,9,\cdots,2 and qq as 8,7,,08,7,\cdots,0 so there are 9 common solutions out of 21(diff values of qq) total , so there are 219\boxed{21 - 9} values of nn

Case 4 : a=6a = 6

We get 11b+c=334    b=0,1,2,,3011b + c = 334 \implies b = 0,1,2, \cdots ,30 and c=334,323,312,,4c = 334,323,312, \cdots ,4 From here we get the different nn's as 18+334,18+325,18+316,,18+6418 + 334,18 + 325,18 + 316, \cdots ,18 + 64

Compact form of terms is Tr=18+64+9(r1)T_r = 18 + 64 + 9(r-1) Now let's repeat the process of eliminating common solutions (one thing to notice is that we've removed common solutions of case 2 from case 3 so if we check case 4 with case 3 we'll remove common solutions from all previous cases and hence we do not have to handle common solutions of case 4 with case 2,1 and in general case X with case X-2,X-3,...2,1 , {basically means checking case X with case X-1 is enough})

Tq=Tr    21+43+9(q1)=18+64+9(r1)    qr=2T_q = T_r \implies 21 + 43 + 9(q-1) = 18 + 64 + 9(r-1) \implies q - r = 2     q=20,19,18,,2\implies q = 20,19,18, \cdots ,2 and r=18,17,16,,0r = 18,17,16, \cdots ,0 so there are 19 common solutions out of 31 (diff values of r) so there are 3119\boxed{31 - 19} values of nn

Now hopefully you've seen a pattern , if not try another case 5 with a=5a = 5 you'll get 4129\boxed{41 - 29} values of nn

Like this we get the value of "distinct" nn by summing all the sub-values from the cases that we've solved.

n=1+11+(219)+(3119)+(4129)++(9179)n = 1 + 11 + (21 - 9) + (31 - 19) + (41 - 29) + \cdots + (91 - 79)     n=(1+11+21+31+41++91)(0+0+9+19+29++79)\implies n = (1 + 11 + 21 + 31 + 41 + \cdots + 91) - (0 + 0 + 9 + 19 + 29 + \cdots + 79)     n=108\implies \boxed{n = 108}

~MrOreoJuice

Solution 4 (Construction, not counting)

First, we note that by the sun of digits and modulo 9 formula, n10001(mod9)n \equiv 1000 \equiv 1 \pmod {9}. Obviously, 1000=111+111+111+111+111+111+111+111+111+11000 = 111+111+111+111+111+111+111+111+111+1 with n=28n=28 is the smallest possible nn. Now, 111=1011+1111=10 \cdot 11 +1, 11=11111= 11 \cdot 1. The first equation applied on a representation with nn 1's (i.e. replacing a 111111, if available, with 10 1111's and one 1) will increase nn by 18, while the second equation applied onto a representation will increase nn by 9 only. Thus, there are representations of n=46,55,64,,1000n= 46,55,64, \dots , 1000, since for 4646 we can just replace a 111111 in n=28n=28 representation with 10 1111's and one 1, and for the rest we use the first equation 111=1011+1111= 10 \cdot 11 +1 to "increase the range" and the second equation to "fill in the gaps" of the first equation. Essentially we use the first equation for every other multiple of nine and the second for the other multiples of nine and for once the 111111's run out. Next, obviously n=1000n=1000 is the maximum nn one can achieve. Thus, the solutions n=28,46,55,64,,1000n=28,46,55,64, \dots ,1000 is all the solutions (one can check there are 108\boxed{108}) if we can show 3737 is impossible. But it is, since a+b+c=37,111a+11b+c=1000a+b+c=37, 111a+11b+c=1000 have no Diophantine solution, so we're done.

~Ddk001

Alternate solutions are always welcome. If you have a different, elegant solution to this problem, please add it to this page.