Skip to main content

2006 AIME II Problem 7

Problem 7 of 15IntermediateNumber TheoryCombinatoricsProblem-Solving Techniques

Find the number of ordered pairs of positive integers (a,b)(a, b) such that a+b=1000a + b = 1000 and neither aa nor bb has a zero digit.

Your answer

Integer from 0 to 999
Show solution

Solution

There are 999999 pairs in all (a=1,…,999a = 1, \ldots, 999); count the forbidden ones. If aa has units digit 0,0, so does b,b, and writing a=10r,a = 10r, b=10sb = 10s gives r+s=100r + s = 100 with 1≤r≤99:1 \le r \le 99: that is 9999 forbidden pairs. Now suppose both units digits are nonzero. Then a number in the pair has a zero digit exactly when it is a three-digit number of the form h0uh0u with h,u∈{1,…,9}h, u \in \{1, \ldots, 9\} (a one- or two-digit number with nonzero units digit has no zero digit). If a=h0u,a = h0u, then b=1000−ab = 1000 - a =100(9−h)+90= 100(9 - h) + 90 +(10−u)+ (10 - u) has tens digit 9,9, so bb is not also of that form. Hence the forbidden pairs here are those where exactly one of a,ba, b equals h0u:h0u: 81+81=16281 + 81 = 162 pairs. The total number of forbidden pairs is 99+162=261,99 + 162 = 261, so the answer is 999−261=738.999 - 261 = 738.
AoPS wiki

Tagged: digits · complementary counting · casework

More practice