AMC 10 Step by Step

2017 AMC 10B Problem 23

P21-25~5 minPrint

Let N=123456789101112…4344N=123456789101112\dots4344 be the 7979 -digit number that is formed by writing the integers from 11 to 4444 in order, one after the other. What is the remainder when NN is divided by 4545 ?

Log in to save your progress.
Show solution without answering

Key insight

Split 45 into 5 and 9. N ends in 4, so its remainder by 5 is 4; its digit sum matches 1 through 44 added up, 990.

Solution

Dividing a 79-digit number by 4545 directly is hopeless. But 45=5⋅945 = 5 \cdot 9, and there are easy tests for 55 and for 99. So find the remainder by 55 and the remainder by 99 separately.

1. Remainder by 5. Only the last digit matters for 55. NN ends in 44, so it leaves remainder 44 when divided by 55.
2. Remainder by 9. A number leaves the same remainder by 99 as the sum of its digits. For example, 4444 has digit sum 88, and 44=36+844 = 36 + 8 leaves remainder 88 too.
3. The digits of NN are the digits of 1,2,3,…,441, 2, 3, \ldots, 44 written one after another. By step 2, each of these numbers has digits adding to something with the same remainder by 99 as the number itself. So the digit sum of NN has the same remainder by 99 as
1+2+⋯+44=44⋅452=990.1 + 2 + \cdots + 44 = \frac{44 \cdot 45}{2} = 990.
4. 990=9⋅110990 = 9 \cdot 110, so NN is a multiple of 99.
5. Put them together. We want a remainder rr between 00 and 4444 that is a multiple of 99 and leaves 44 when divided by 55. The multiples of 99 in that range are 0,9,18,27,360, 9, 18, 27, 36; divided by 55 they leave 0,4,3,2,10, 4, 3, 2, 1. Only r=9r = 9 works.
6. Why this is right: N−9N - 9 is a multiple of 99 (both NN and 99 are) and a multiple of 55 (both leave 44). A number that is a multiple of both 55 and 99 is a multiple of 4545. So NN leaves remainder 99 when divided by 4545.

The answer is (C) 9\boxed{\textbf{(C)}\ 9}.

Why this works

When the divisor is a product of two numbers with no common factor, such as 45=5⋅945 = 5 \cdot 9, handle each piece with its own easy test and then combine. The digit-sum test for 99 also works on pieces: gluing numbers together adds their digit sums, so the whole 7979-digit number behaves like the plain sum 1+2+⋯+441 + 2 + \cdots + 44.

Alternative approach

Use the answer choices. The remainder must be a multiple of 99, which leaves only 99 and 1818. It must also leave 44 when divided by 55: 99 does, 1818 does not.

If you prefer to add the digits directly: 11 to 99 give 4545; the tens digits of 1010 to 4444 give 10⋅1+10⋅2+10⋅3+5⋅4=8010 \cdot 1 + 10 \cdot 2 + 10 \cdot 3 + 5 \cdot 4 = 80; their ones digits give 3⋅45+(0+1+2+3+4)=1453 \cdot 45 + (0 + 1 + 2 + 3 + 4) = 145. The total 45+80+145=270=9⋅3045 + 80 + 145 = 270 = 9 \cdot 30 is a multiple of 99.

Concise solution

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

Since 45=5⋅945 = 5 \cdot 9 with gcd⁡(5,9)=1\gcd(5, 9) = 1, find NN modulo 55 and modulo 99 separately.

Mod 55: only the last digit matters, and NN ends in 44. So N≡4(mod5)N \equiv 4 \pmod 5.

Mod 99: a number is congruent to its digit sum mod 99. The digits of NN are the digits of 1,2,…,441, 2, \dots, 44, and each integer kk is congruent to its own digit sum mod 99. Hence
N≡1+2+⋯+44=44⋅452=990≡0(mod9),N \equiv 1 + 2 + \dots + 44 = \frac{44 \cdot 45}{2} = 990 \equiv 0 \pmod 9,
because 9+9+0=189 + 9 + 0 = 18 is a multiple of 99.

Now find the residue mod 4545 that is 0 mod 90 \bmod 9 and 4 mod 54 \bmod 5. The multiples of 99 below 4545 are 0,9,18,27,360, 9, 18, 27, 36; their residues mod 55 are 0,4,3,2,10, 4, 3, 2, 1. Only 99 works.

The answer is (C) 9\boxed{\textbf{(C)}\ 9}.

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.