Let be the -digit number that is formed by writing the integers from to in order, one after the other. What is the remainder when is divided by ?
- A)
- B)
- C)
- D)
- E)
Answer
C
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 directly is hopeless. But , and there are easy tests for and for . So find the remainder by and the remainder by separately.
1. Remainder by 5. Only the last digit matters for . ends in , so it leaves remainder when divided by .
2. Remainder by 9. A number leaves the same remainder by as the sum of its digits. For example, has digit sum , and leaves remainder too.
3. The digits of are the digits of written one after another. By step 2, each of these numbers has digits adding to something with the same remainder by as the number itself. So the digit sum of has the same remainder by as
4. , so is a multiple of .
5. Put them together. We want a remainder between and that is a multiple of and leaves when divided by . The multiples of in that range are ; divided by they leave . Only works.
6. Why this is right: is a multiple of (both and are) and a multiple of (both leave ). A number that is a multiple of both and is a multiple of . So leaves remainder when divided by .
The answer is .
Why this works
When the divisor is a product of two numbers with no common factor, such as , handle each piece with its own easy test and then combine. The digit-sum test for also works on pieces: gluing numbers together adds their digit sums, so the whole -digit number behaves like the plain sum .
Alternative approach
Use the answer choices. The remainder must be a multiple of , which leaves only and . It must also leave when divided by : does, does not.
If you prefer to add the digits directly: to give ; the tens digits of to give ; their ones digits give . The total is a multiple of .
The trap
Adding all 79 digits one at a time and slipping. The digits of each small number add to something with the same remainder by 9 as the number itself.
Concise solution
Since with , find modulo and modulo separately.
Mod : only the last digit matters, and ends in . So .
Mod : a number is congruent to its digit sum mod . The digits of are the digits of , and each integer is congruent to its own digit sum mod . Hence
because is a multiple of .
Now find the residue mod that is and . The multiples of below are ; their residues mod are . Only works.
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Introduction to Number Theory, Chapter 8: Base Numbers
- Introduction to Number Theory, Chapter 10: Units Digits
- Introduction to Number Theory, Chapter 9: Base Number Arithmetic
Techniques
Use the answer choices (mod checks, size, form) to eliminate or select · Set up the equation/formula and compute; no special trick needed