# Strange Numbers

We define "strange" numbers in the following way:

- All strange numbers are prime.

- Every single digit prime number is strange.

- A number with two or more digits is strange if, and only if, the two numbers obtained from it, by removing either its first or its last digit, are also strange.

Find all strange numbers.

This problem comes from the Hungarian magazine KoMaL. You can find many other challenging problems in English on the KoMaL website.

This solution came from Paul Jefferys.

We know that 2, 3, 5, 7 are strange. They are the only 1 digit strange numbers. All 2-digit strange numbers must be made up of these digits and must be prime. An exhaustive search reveals that they are 23, 37, 53, 73 as all other 2-digit numbers with these digits are not prime.

As no 2-digit strange numbers end in 2, and only 37 begins with a 3, we see that the only possible 3-digit number with 23 in it is 237, but this is not strange as it is a multiple of 3.

If we take 37, then we have to consider 237, 537, 737, 373, but 237 and 537 are multiples of 3, so we have 737 and 373, but then 737=11*67, so we are left with 373, which is prime.

Taking 53, the only possibility is 537 which is not prime.

From 73 there can only be 373 and 737, but 737 is not prime, so the only 3-digit strange number is 373.

Therefore there are NO 4-digit strange numbers as there is no 3-digit strange number ending 37. If there are no n-digit strange numbers then there cannot be any n+1 digit strange numbers as the shortened forms produced by removing the first or last digit of the n+1 digit number, which need to be strange, cannot be strange. So we have found all the strange numbers 2, 3, 5, 7, 23, 37, 53, 73, 373.