Maths Olympiad Prep

Library / /9 of 30

Number theory Difficulty 5.4 AIME, harder Prove it Ireland

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 11. One solution is 1111. We rule out 11, 111111 as it is divisible by 33, and 11111111 which is divisible by 1111.

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 1010 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 11: otherwise the non-zero digits are at least 22 and 33, 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 33, the number is divisible by 33 and can be ruled out. The remaining cases are as follows.

Case 2: Four digits, namely 22, 11, 11, 00. The number must end in 11 and start with 11 or 22. The possibilities are 10211021, 12011201, 20112011, and 21012101. 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 3535 (since, by the hint, 35>120135 > \sqrt{1201}).

Case 3: Four digits, namely 33, 11, 00, 00. The only possibilities are 10031003 and 30013001. Both are ruled out: the former is divisible by 1717, the latter is too big. In summary, we have exactly three solutions: 1111, 10211021, 12011201.

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.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.