Maths Olympiad Prep

Track / Stage 7 / 141 of 300 #1541 of 1964

Problem 1541

National olympiad second round; IMO P1/P4
Number theory Difficulty 7.2 Prove it

We call a number [i]pal[/i] if it doesn't have a zero digit and the sum of the squares of the digits is a perfect square. For example, 122122 and 3434 are pal but 304304 and 1212 are not pal. Prove that there exists a pal number with nn digits, n>1n > 1.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Official solution

1. Define the problem and initial observations:
We need to prove that there exists a pal number with n n digits for n>1 n > 1 . A pal number is defined as a number that does not contain the digit zero and the sum of the squares of its digits is a perfect square.

2. Constructing pal numbers:
Notice that for any digit d d , the number consisting of n n repetitions of d d (i.e., ddddn d’s \underbrace{ddd \dots d}_{n \text{ d's}} ) will have the sum of the squares of its digits as nd2 n \cdot d^2 . We need this sum to be a perfect square.

3. Using Pythagorean triples:
Consider the Pythagorean triple 52=32+42 5^2 = 3^2 + 4^2 . This suggests that we can use the digits 3 and 4 to form pal numbers. For example, the number 34 has digits whose squares sum to 32+42=9+16=25 3^2 + 4^2 = 9 + 16 = 25 , which is a perfect square.

4. **Generalizing for n n digits:**
If n n is a perfect square, say n=k2 n = k^2 , then the number consisting of k2 k^2 repetitions of the digit 5 (i.e., 55555k2 5’s \underbrace{555 \dots 55}_{k^2 \text{ 5's}} ) will have the sum of the squares of its digits as k252=25k2 k^2 \cdot 5^2 = 25k^2 , which is a perfect square.

5. **Extending to n+1 n+1 digits:**
To extend this to n+1 n+1 digits, we can replace one of the 5's with the digits 3 and 4. For example, if we have k2 k^2 digits of 5, we can replace one 5 with 34, resulting in a number with k2+1 k^2 + 1 digits. The sum of the squares of the digits will be:
25k225+9+16=25k2 25k^2 - 25 + 9 + 16 = 25k^2
which is still a perfect square.

6. Ensuring sufficient digits:
We need to ensure that there are enough digits to perform this operation. For n=k2 n = k^2 , we have k2 k^2 digits of 5. For n+1 n+1 digits, we need to show that:
k2+1(k+1)2 k^2 + 1 \ge (k+1)^2
Simplifying, we get:
k2+1k2+2k+1    12k k^2 + 1 \ge k^2 + 2k + 1 \implies 1 \ge 2k
This inequality is not true for k>1 k > 1 . However, we can use the fact that for k>1 k > 1 , we can always find a combination of digits that satisfies the condition.

7. Conclusion:
Therefore, for any n>1 n > 1 , we can construct a pal number by using the digits 3, 4, and 5 in appropriate combinations to ensure that the sum of the squares of the digits is a perfect square.

\blacksquare

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.