AMC 10 Step by Step

2018 AMC 10A Problem 25

P21-25~10 minPrint

For a positive integer nn and nonzero digits aa , bb , and cc , let AnA_n be the nn -digit integer each of whose digits is equal to aa ; let BnB_n be the nn -digit integer each of whose digits is equal to bb , and let CnC_n be the 2n2n -digit (not nn -digit) integer each of whose digits is equal to cc . What is the greatest possible value of a+b+ca + b + c for which there are at least two values of nn such that Cn−Bn=An2C_n - B_n = A_n^2 ?

Log in to save your progress.
Show solution without answering

Key insight

Using R = 11...1, the equation becomes (9c minus a squared) times R = b minus 2c. Two values of n force both sides to be 0.

Solution

Every number here is a repeated digit, so write each one using a string of ones. Let RR be the nn-digit number 11…111\ldots1.

1. Write AnA_n and BnB_n. An=aRA_n = aR and Bn=bRB_n = bR. For example, with n=2n = 2, 66=6⋅1166 = 6 \cdot 11.
2. Write CnC_n. A 2n2n-digit string of ones is RR followed by RR, which is R⋅(10n+1)R \cdot (10^n + 1). For example, 1111=11⋅1011111 = 11 \cdot 101. Also 10n+1=9R+210^n + 1 = 9R + 2 (check: 101=9⋅11+2101 = 9 \cdot 11 + 2). So
Cn=c⋅R⋅(9R+2).C_n = c \cdot R \cdot (9R + 2).
3. Put everything into Cn−Bn=An2C_n - B_n = A_n^2.
cR(9R+2)−bR=a2R2.cR(9R + 2) - bR = a^2 R^2.
Every term has a factor RR, so divide it out:
9cR+2c−b=a2R.9cR + 2c - b = a^2 R.
Move the RR terms to one side:
(9c−a2)⋅R=b−2c.(9c - a^2) \cdot R = b - 2c.
4. Why two values of nn matter. Different nn give different RR (11, 1111, 111111, ...), but the right side b−2cb - 2c stays the same. If 9c−a29c - a^2 were not 00, only one value of RR could make the two sides equal, so only one nn would work. For two values of nn we need
9c=a2andb=2c,9c = a^2 \qquad\text{and}\qquad b = 2c,
and then the equation holds for every nn.
5. Try the digits. a2=9ca^2 = 9c means a2a^2 is a multiple of 99, so aa is 33, 66 or 99.
- a=3a = 3: c=1c = 1, b=2b = 2. Sum 66.
- a=6a = 6: c=4c = 4, b=8b = 8. Sum 1818.
- a=9a = 9: c=9c = 9, b=18b = 18, which is not a digit.

The largest sum is 6+8+4=186 + 8 + 4 = 18.
6. Check. n=1n = 1: 44−8=36=6244 - 8 = 36 = 6^2. n=2n = 2: 4444−88=4356=6624444 - 88 = 4356 = 66^2.

The answer is (D) 18\boxed{\textbf{(D)}\ 18}.

Why this works

Numbers made of one repeated digit are that digit times a string of ones, and a string of 2n2n ones is built from the string of nn ones. That turns the whole problem into one equation in RR. The equation has the form (number) times RR = (number), and if it must hold for two different RR, both numbers must be 00. "At least two values of nn" is the hint to use this.

Alternative approach

Write out n=1n = 1 and n=2n = 2 to see where the conditions come from. For n=1n = 1: cc‾−b=a2\overline{cc} - b = a^2, so a2+b=11ca^2 + b = 11c. For n=2n = 2: 1111c−11b=121a21111c - 11b = 121a^2, so dividing by 1111, 11a2+b=101c11a^2 + b = 101c. Multiply the first equation by 1111 and subtract the second: 10b=20c10b = 20c, so b=2cb = 2c, and then a2=9ca^2 = 9c. This shows what happens when n=1n = 1 and n=2n = 2 both work; the main solution shows the same must happen for any two values of nn.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

Let R=10n−19=11…1R = \dfrac{10^n - 1}{9} = 11\ldots1 (nn ones). Then An=aRA_n = aR, Bn=bRB_n = bR, and, since 102n−1=(10n−1)(10n+1)10^{2n} - 1 = (10^n - 1)(10^n + 1) with 10n+1=9R+210^n + 1 = 9R + 2,
Cn=c⋅102n−19=cR(9R+2).C_n = c \cdot \frac{10^{2n} - 1}{9} = cR(9R + 2).

The condition Cn−Bn=An2C_n - B_n = A_n^2 becomes
cR(9R+2)−bR=a2R2.cR(9R + 2) - bR = a^2 R^2.
Divide by R≠0R \ne 0 and rearrange:
9cR+2c−b=a2R⟹R (9c−a2)=b−2c.9cR + 2c - b = a^2 R \quad\Longrightarrow\quad R\,(9c - a^2) = b - 2c.

The right side does not depend on nn, while RR takes different values for different nn. If 9c−a2≠09c - a^2 \ne 0, then R=b−2c9c−a2R = \dfrac{b - 2c}{9c - a^2} is a single value, so at most one nn works. Two values of nn therefore force
9c=a2andb=2c,9c = a^2 \qquad\text{and}\qquad b = 2c,
and then the equation holds for every nn.

a2=9ca^2 = 9c means aa is a multiple of 33: a=3a = 3 gives c=1c = 1, b=2b = 2 (sum 66); a=6a = 6 gives c=4c = 4, b=8b = 8 (sum 1818); a=9a = 9 gives c=9c = 9, b=18b = 18, not a digit. The maximum is 6+8+4=186 + 8 + 4 = 18.

Check with n=1n = 1: 44−8=36=6244 - 8 = 36 = 6^2; with n=2n = 2: 4444−88=4356=6624444 - 88 = 4356 = 66^2.

The answer is (D) 18\boxed{\textbf{(D)}\ 18}.

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.