Maths Olympiad Prep

Library / /38 of 43

, 2006

Number theory Difficulty 6.1 National Olympiad Prove it Italy

Problem:

How many five-digit numbers (that is, between 1000010000 and 9999999999) contain no zeros and are multiples of 1212?

Solutions — 2

Solution 1

Solution:

The answer is 43744374. To determine exactly how many numbers we need to count, let us first recall that a number is divisible by 1212 if and only if it is divisible by 44 and by 33, and the divisibility criteria tell us that:
- The last two digits of the number must form a multiple of 44.
- The sum of the digits of the number must be divisible by 33.
The idea on which this solution is based is that of "generating" all the possible numbers of this type by choosing the digits in order from the last to the first.

a. First let us count in how many ways we can choose the last two digits: they must form a two-digit multiple of 44 that contains no zeros, and the possibilities for this choice are 1818 (all the multiples of 44 less than 100100 are 2525, but from these we must discard 00,04,08,20,40,60,8000, 04, 08, 20, 40, 60, 80, which contain at least one zero).

b. The second and third digits of the number can each be chosen in 99 different ways (all the digits from 11 to 99) independently of all the other digits. Now we still have to choose the first digit of the number, and take care of divisibility by 33.

c. The first digit can be chosen in 99 different ways, but not all these choices allow us to obtain divisibility by 33. However, since the nine digits from 11 to 99 have equal remainders upon division by 33 in groups of three, once we have fixed all the preceding digits exactly 33 of the possible choices for the first digit are acceptable.

Summing up, we can choose a number satisfying the required conditions in 18993=437418 \cdot 9 \cdot 9 \cdot 3 = 4374 different ways. It is easy to check that in this way we generate all the chosen numbers, since the divisibility criteria are necessary and sufficient conditions.

Solution 2

Solution:

Let us first impose that the number be a multiple of 44; then its last two digits must be one of the multiples of 44 between 0000 and 9999; such multiples are 2525, but among these there are 77 that contain at least one zero and must therefore be discarded. We are left with 1818 possibilities for the final digits. Now we must choose the other three digits (nonzero) so that the sum of all five digits is a multiple of 33, in order to guarantee divisibility by 33. Using congruences modulo 33, we observe that, for every possible remainder of division by 33, there are exactly 33 numbers between 11 and 99 that give that remainder (1,4,71, 4, 7; 2,5,82, 5, 8; 3,6,93, 6, 9). Up to order, the various remainders modulo 33 can be obtained as the sum of 33 remainders in the following ways:

00+0+01+1+12+2+20+1+2(mod3)0 \equiv 0+0+0 \equiv 1+1+1 \equiv 2+2+2 \equiv 0+1+2 \pmod{3}

10+0+10+2+21+1+2(mod3)1 \equiv 0+0+1 \equiv 0+2+2 \equiv 1+1+2 \pmod{3}

20+1+10+0+21+2+2(mod3)2 \equiv 0+1+1 \equiv 0+0+2 \equiv 1+2+2 \pmod{3}

To also take order into account, we observe that 0+1+20+1+2 can be permuted in 66 ways, 0+0+00+0+0 and similar ones have no permutations, while all the others can be permuted in 33 ways. Therefore, taking order into account, every remainder can be written in 99 different ways as the sum of 33 remainders; hence, for a fixed remainder, we can form a 33-digit number giving that remainder and containing no 00 in 9339 \cdot 3^{3} ways, and therefore, regardless of which last two digits we choose, we will have 9339 \cdot 3^{3} ways to complete the number so that it is a multiple of 33, without inserting zeros. In total we will therefore have 18927=437418 \cdot 9 \cdot 27 = 4374 ways.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement translated into English from it; metadata (topic, difficulty) added by this project.