47. BOARD IN CHURCH
I really had trouble concentrating in church this morning. At one stage I glanced at the hymn board, and was surprised to notice that all the digits 1, 2, 3, ... , 9 were included in the three numbers displayed. Not only that, but each of the numbers was a prime number (that is, each number had no factors, apart from itself and 1 of course).
It turned out that the first number was for a chorus and the remaining two were hymn numbers. Now that I am home again (much uplifted from the service!) I have quite forgotten what the numbers were. I do know that we only have 150 choruses in our book, and the hymn book contains 600 numbers. I normally flatter myself on having a good memory. I wonder what they could have been ... .
Note: A table of primes less than 600 is required to solve this problem. If one is not available, the table can be constructed by considering a list from 100 to 600 and deleting multiples of 2, 3, 5, 7, 11, 13, 17, 19, 23. Primes not satisfying the problem conditions can also be deleted.
Hint 1
How many digits does each number have?
Hint 2
List the possible numbers which can be placed in each column, according to the given information.
Solution
Since all the numbers are less than 600, they have at most 3 digits each. Since there are nine digits altogether, each number is a 3-digit number.
The first digit of the chorus number must be 1. Each number is a prime, so cannot end with 2, 4, 5, 6 or 8. Hence the final digits are 3, 7 and 9 in some order. The first digits of the hymn numbers must be two of 2, 4 or 5 (less than 6, and the 3 is already accounted for).
In fact the possible choice of primes is quite small, once we disallow primes containing 0, primes containing 1 in the second or third position, primes containing 3, 7 or 9 in any but the third position, and primes with a repeated digit.
From the table we now quickly eliminate cases. Suppose the numbers are 1 _ _ , 2 _ _ , 4 _ _ . Since 9 occurs, we have either 149 or 269. If 149, then no third number 4 _ _ satisfies the conditions. Similarly, if 269, then 157 is forced,which is disallowed. In this way we now check numbers with first digits 1, 2, 5 and 1, 4, 5. The unique solution is 149, 263 and 587.
Extensions
1. Are there five two-digit primes which use up all the digits from 0 to 9 exactly once?
2. Are there four prime numbers of unspecified length which together use up all the digits from 0 to 9 exactly once? Write your own problem by setting this in some context.
Hint 1
Hint 2
Solution
Extensions