Browse · MathNet
PrintIreland
Ireland number theory
Problem
2011 is prime and the sum of its digits equals its number of digits. Find all smaller primes with this property; a leading zero is not allowed.
Solution
Case 1: All digits equal to . One solution is . We rule out , as it is divisible by , and which is divisible by .
In all other cases there is at least one zero. Zeros are not allowed in the leading position, or in the final position (multiples of are non-prime). Thus there are non-zero digits in the (separate) first and last positions and the one in the last position must be odd.
There must be at least one digit : otherwise the non-zero digits are at least and , giving a five-digit number which is too large. In particular, there are at least three digits, in fact exactly four digits since if the digit sum is , the number is divisible by and can be ruled out. The remaining cases are as follows.
Case 2: Four digits, namely , , , . The number must end in and start with or . The possibilities are , , , and . The latter pair are ruled out because they are too large, but the former pair are both prime, as can be verified by testing against all primes less than (since, by the hint, ).
Case 3: Four digits, namely , , , . The only possibilities are and . Both are ruled out: the former is divisible by , the latter is too big. In summary, we have exactly three solutions: , , .
In all other cases there is at least one zero. Zeros are not allowed in the leading position, or in the final position (multiples of are non-prime). Thus there are non-zero digits in the (separate) first and last positions and the one in the last position must be odd.
There must be at least one digit : otherwise the non-zero digits are at least and , giving a five-digit number which is too large. In particular, there are at least three digits, in fact exactly four digits since if the digit sum is , the number is divisible by and can be ruled out. The remaining cases are as follows.
Case 2: Four digits, namely , , , . The number must end in and start with or . The possibilities are , , , and . The latter pair are ruled out because they are too large, but the former pair are both prime, as can be verified by testing against all primes less than (since, by the hint, ).
Case 3: Four digits, namely , , , . The only possibilities are and . Both are ruled out: the former is divisible by , the latter is too big. In summary, we have exactly three solutions: , , .
Final answer
11, 1021, 1201
Techniques
Prime numbersFactorization techniques