Problem:
Determine for which positive integers there exists a positive integer such that
- is a multiple of 2022,
- the decimal expression of contains only digits 0 and 7,
- the decimal expression of contains the digit 7 exactly times.
Problem:
Determine for which positive integers there exists a positive integer such that
- is a multiple of 2022,
- the decimal expression of contains only digits 0 and 7,
- the decimal expression of contains the digit 7 exactly times.
Solution:
The required values of are all and only the multiples of 3.
Necessary condition Let be a multiple of 2022 whose decimal expression contains the digit 7 exactly times, and possibly other digits 0. Since 2022 is a multiple of 3, must also be a multiple of 3, and therefore (by the divisibility criterion for 3) the sum of the digits of must in turn be a multiple of 3. Now the sum of the digits of is , and this is a multiple of 3 only if is a multiple of 3.
Sufficient condition We observe that the number is a multiple of 2022 and its decimal expression contains three digits 7 and two digits 0. This shows in particular that has the required property.
More generally, for every positive integer we observe that the number written by repeating times the block of five digits 70770, that is, the number
is in turn a multiple of 2022 and its decimal expression contains the digit 7 times and the digit 0 times. This shows that every multiple of 3 has the required property.