Let be a natural number. Given two natural numbers and with digits, is a friend of if and only if the numbers obtained substituting each one of the digits of by the digit of which is on the same position are all multiples of . Find all the values of for which the following condition is valid:
For any two numbers and with digits, is a friend of if and only if is a friend of .
Problem 1473
Official solution
1. Define the problem and notation:
Let be a natural number. Given two natural numbers and with digits, is a friend of if and only if the numbers obtained by substituting each one of the digits of by the digit of which is in the same position are all multiples of . We need to find all values of for which the following condition is valid: For any two numbers and with digits, is a friend of if and only if is a friend of .
2. **Express and in terms of their digits:**
Let and .
3. **Condition for to be a friend of :**
The statement that is a friend of is equivalent to:
4. **Case 1: :**
- Assume is a friend of and vice versa.
- Summing all the equalities, we get:
- Subtracting these two congruences:
- Since and are congruent modulo 7, we can write:
- This implies .
- However, there exist numbers and such that is a friend of and . For example, take , , and . If , then:
and if , then:
- This shows that is not necessarily a friend of , contradicting the condition.
5. **Case 2: :**
- Assume is a friend of .
- Summing the equalities , we get:
- This implies:
so is a friend of , as desired.
6. Conclusion:
The only values of for which the condition is valid are those such that .
The final answer is .