Maths Olympiad Prep

Library / /1248 of 1394

, 2015

Combinatorics Difficulty 5.9 AIME, harder Prove it United States

Problem:

Let SS be the set of all 3-digit numbers with all digits in the set {1,2,3,4,5,6,7}\{1,2,3,4,5,6,7\} (so in particular, all three digits are nonzero). For how many elements abc\overline{a b c} of SS is it true that at least one of the (not necessarily distinct) "digit cycles"
abc,bca,cab \overline{a b c}, \overline{b c a}, \overline{c a b}
is divisible by 77? (Here, abc\overline{a b c} denotes the number whose base 10 digits are a,ba, b, and cc in that order.)

Solution

Solution:

Answer: 127

Since the value of each digit is restricted to {1,2,,7}\{1,2, \ldots, 7\}, there is exactly one digit representative of each residue class modulo 77.

Note that 7abc7 \mid \overline{a b c} if and only if 100a+10b+c0(mod7)100 a + 10 b + c \equiv 0 \pmod{7} or equivalently 2a+3b+c02a + 3b + c \equiv 0. So we want the number of triples of residues (a,b,c)(a, b, c) such that at least one of 2a+3b+c02a + 3b + c \equiv 0, 2b+3c+a02b + 3c + a \equiv 0, 2c+3a+b02c + 3a + b \equiv 0 holds.

Let the solution sets of these three equations be S1,S2,S3S_1, S_2, S_3 respectively, so by PIE and cyclic symmetry we want to find 3S13S1S2+S1S2S33|S_1| - 3|S_1 \cap S_2| + |S_1 \cap S_2 \cap S_3|.

Clearly S1=72|S_1| = 7^2, since for each of aa and bb there is a unique cc that satisfies the equation.

For S1S2S_1 \cap S_2, we may eliminate aa to get the system 02(2b+3c)(3b+c)=b+5c0 \equiv 2(2b + 3c) - (3b + c) = b + 5c (and a2b3ca \equiv -2b - 3c), which has 77 solutions (one for each choice of cc).

For S1S2S3S1S2S_1 \cap S_2 \cap S_3 \subseteq S_1 \cap S_2, we have from the previous paragraph that b5cb \equiv -5c and a10c3c0a \equiv 10c - 3c \equiv 0. By cyclic symmetry, b,c0b, c \equiv 0 as well, so there's exactly 11 solution in this case.

Thus the answer is 37237+1=1273 \cdot 7^2 - 3 \cdot 7 + 1 = 127.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.