Maths Olympiad Prep

Library / /2 of 9

, 2019

Number theory Difficulty 5.9 AIME, harder Prove it Japan

Call a positive integer a good number if its every digit is a prime number. Find all the good numbers having three digits and with the property that their squares are good numbers of five digits.

Solution

235

Let nn be a three-digit good number, then we can write n=100a+10b+cn = 100a + 10b + c, where a,b,ca, b, c are 1-digit primes. If n2n^2 is a good number with 5 digits, we must have n2<105n^2 < 10^5, from which it follows that we have n<320n < 320. Since 10b+c2210b + c \ge 22, we conclude that a=2a = 2 must hold. When c=2,3,5,7c = 2, 3, 5, 7, the lowest digit of n2n^2 is 4, 9, 5, 9, respectively. If n2n^2 is also a good number, the lowest digit of n2n^2 must be 5, which, in turn, implies that c=5c = 5 must hold.

Since a=2a = 2 and c=5c = 5, we conclude that the possibilities for the choice of nn is 225, 235, 255, 275. But, then n2=50625,55225,65025,75625n^2 = 50625, 55225, 65025, 75625, among which 55225=235255225 = 235^2 is the only good number. Therefore, we conclude that n=235n = 235 is the desired answer.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.