Skip to main content

2004 AIME II Problem 14

Problem 14 of 15HarderNumber TheoryProblem-Solving Techniques

Consider a string of nn 77’s, 7777…77,7777\ldots77, 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 7000?7000?

Your answer

Integer from 0 to 999
Show solution

Solution

Dividing by 77 turns the summands into 1,1, 11,11, or 111111 (no summand with four or more digits fits, since 1111>10001111 \gt 1000) and the target into 1000.1000. If x,x, y,y, zz count the summands of each size, then x+11y+111z=1000x + 11y + 111z = 1000 and n=x+2y+3z.n = x + 2y + 3z. Subtracting gives n=1000−9(y+12z),n = 1000 - 9(y + 12z), so the possible nn correspond exactly to the attainable values of v=y+12z.v = y + 12z. The constraints are z≤9z \le 9 and 0≤y≤1000−111z110 \le y \le \frac{1000 - 111z}{11} (then x≥0x \ge 0 follows). For z=0,1,…,9z = 0, 1, \ldots, 9 the value v=y+12zv = y + 12z ranges over the intervals [0,90],[0, 90], [12,92],[12, 92], [24,94],[24, 94], [36,96],[36, 96], [48,98],[48, 98], [60,100],[60, 100], [72,102],[72, 102], [84,104],[84, 104], [96,106],[96, 106], and {108}\{108\} (when z=9,z = 9, only y=0y = 0 fits). Their union is every integer from 00 to 106106 together with 108;108; only 107107 is unattainable. So vv takes 107+1=108107 + 1 = 108 values, and n=1000−9vn = 1000 - 9v takes 108108 values.
AoPS wiki

Tagged: Diophantine Equation · digits · casework

More practice