Find all natural numbers for which each natural number having digits '1' and one digit '7' in its decimal representation is prime.
Solution
A number having digits '1' and one digit '7' in decimal representation is of the form where is a number having digits '1', and . Notice that if then the sum of the digits of is . Notice that
Let . Then where , . Then
If then , so therefore we saw that is not prime in any case. Suppose does not divide . Then we saw that and additionally is not congruent to modulo . Put . For this , from the above it follows that we can choose , , such that . So this is divisible by . For we saw that the numbers are composite. We need to check all cases . For
For , . In the case we already saw that all numbers are composite. For and all numbers are prime.
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.