Skip to main content
OlympiadHQ

Browse · MATH

Print

jmc

number theory senior

Problem

A positive number is called -primable if it is divisible by and each of its digits is a one-digit prime number. How many 3-primable positive integers are there that are less than 1000?
Solution
The one-digit prime numbers are 2, 3, 5, and 7. A number is divisible by 3 if and only if the sum of its digits is divisible by 3. So we want to count the number of ways we can pick three or fewer of these digits that add up to a multiple of 3 and form a number with them. We will use modular arithmetic. Of our allowable digits, , , , and . The ways to add up 3 or fewer numbers to get 0 modulo 3 are shown:

1. 0

2. 0 + 0

3. 1 + 2

4. 0 + 0 + 0

5. 1 + 1 + 1

6. 2 + 2 + 2

7. 0 + 1 + 2

We will count the number of 3-primable integers each case produces:

1. There is 1 number, 3.

2. There is 1 number, 33.

3. One of the digits is 7, and the other digit is either 2 or 5. So there are 2 choices for this digit, and once the digit is chosen, there are 2 ways to arrange the digits of the 3-primable number (for example, if we choose the digit 2, then we could either have 72 or 27). So there are numbers in this case.

4. There is 1 number, 333.

5. There is 1 number, 777.

6. Each of the three digits is either 2 or 5. This gives numbers.

7. One of the digits is 3, one of the digits is 7, and the other digit is either 2 or 5. Once we choose either 2 or 5, there are ways to arrange the digits of the 3-primable number. So there are numbers in this case.

So in total, our answer is .
Final answer
28