Let be the set of all 3-digit numbers with all digits in the set (so in particular, all three digits are nonzero). For how many elements of is it true that at least one of the (not necessarily distinct) 'digit cycles' is divisible by 7? (Here, denotes the number whose base 10 digits are , and in that order.)
Solution
Since the value of each digit is restricted to , there is exactly one digit representative of each residue class modulo 7. Note that if and only if or equivalently . So we want the number of triples of residues such that at least one of , holds. Let the solution sets of these three equations be respectively, so by PIE and cyclic symmetry we want to find . Clearly , since for each of and there is a unique that satisfies the equation. For , we may eliminate to get the system (and , which has 7 solutions (one for each choice of ). For , we have from the previous paragraph that and . By cyclic symmetry, as well, so there's exactly 1 solution in this case. Thus the answer is .
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.