Fair and Square

144 is a perfect square. When the first and last digit are interchanged, we obtain a different perfect square, 441.

Likewise, there exist two distinct perfect squares of four digits, which differ only in the interchange of the first and last digits. Give the greatest of these two perfect squares.


Note : There are only 68 four-digit perfect squares, so this problem can be solved fairly easily by writing them all out. However, can you find a way that reduces the amount of work to be done?

For the five-digit version, see this problem .


The answer is 4761.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Arjen Vreugdenhil
Aug 19, 2017

Let the two squares be N 2 > M 2 N^2 > M^2 . Since they have four digits, it is clear that 99 N > M 32 99 \geq N > M \geq 32 .

If a > d > 0 a > d > 0 are the first and last digits of N 2 N^2 , then we have N 2 M 2 = ( 1000 a d ) ( 1000 d a ) = 999 ( a d ) . N^2 - M^2 = (1000a - d) - (1000d - a) = 999(a - d). Define h = a d h = a - d ; we have ( N + M ) ( N M ) = 999 h , 1 h 8. (N + M)(N - M) = 999h,\ \ \ 1 \leq h \leq 8. We know that { N M 99 32 = 67 64 N + M 198 \begin{cases} N - M \leq 99 - 32 = 67 \\ 64 \leq N + M \leq 198 \end{cases} Moreover, the prime factor decomposition 999 = 3 3 37 999 = 3^3\cdot 37 . This means that either N + M N + M or N M N - M is a multiple of 37. This greatly reduces the number of situations we must consider. The above equations are necessary conditions for finding the solution, but not sufficient . We must therefore carefully check each solution to see if it really works.

Case 1 . If N + M N + M is a multiple of 37, then it is at least 2 × 37 = 74 2\times 37 = 74 and at most 5 × 37 = 185 5\times 37 = 185 .

In the special situation N + M = 111 = 3 × 37 N + M = 111 = 3\times 37 , N M = 3 2 h N - M = 3^2 h is a multiple of 9. Since N + M N + M and N M N - M are of equal parity, h h must be odd; we have the possibilities

  • h = 1 h = 1 , N M = 9 N - M = 9 , N = ( 111 + 9 ) / 2 = 60 N = (111+9)/2 = 60 , M = ( 111 9 ) / 2 = 51 M = (111-9)/2 = 51 ; this is not a solution because N 2 N^2 may not end in zero.

  • h = 3 h = 3 , N M = 27 N - M = 27 , N = ( 111 + 27 ) / 2 = 69 N = (111+27)/2 = 69 , M = ( 111 27 ) / 2 = 42 M = (111-27)/2 = 42 . This is the solution we look for: 6 9 2 = 4761 , 4 2 2 = 1764. 69^2 = \boxed{4761},\ \ \ 42^2 = 1764.

  • h = 5 h = 5 , N M = 45 N - M = 45 , N = 78 N = 78 , M = 33 M = 33 . However, 7 8 2 = 6084 78^2 = 6084 and 3 3 2 = 1089 33^2 = 1089 ; this is not a solution.

Otherwise, N M N - M is a multiple of 3 3 = 27 3^3 = 27 , i.e. equal to either 27 27 or 54 54 . Again, N + M N + M and N M N - M must have equal parity. Thus

  • N + M = 2 37 = 74 N + M = 2\cdot 37 = 74 , N M = 54 N - M = 54 , N = 64 N = 64 , M = 10 M = 10 . This would make M 2 M^2 end in zero, which is not possible.

  • N + M = 4 37 = 148 N + M = 4\cdot 37 = 148 , N M = 54 N - M = 54 , N = 101 N = 101 is too large.

  • N + M = 5 37 = 185 N + M = 5\cdot 37 = 185 , N M = 27 N - M = 27 , N = 106 N = 106 is too large.

Case 2 . If N M N - M is a multiple of 37, then it must be equal to 37, and N + M = 27 h N + M = 27h . Equal parity requires that h h is odd. Thus

  • N M = 37 N - M = 37 , N + M = 3 × 27 = 81 N + M = 3\times 27 = 81 , N = 59 N = 59 , M = 22 M = 22 . But this would give M 2 M^2 only three digits.

  • N M = 37 N - M = 37 , N + M = 5 × 27 = 135 N + M = 5\times 27 = 135 , N = 86 N = 86 , M = 49 M = 49 . However, then M 2 M^2 would end in 1 and N 2 N^2 is clearly greater than 2000. This is not a solution.

  • N M = 37 N - M = 37 , N + M = 7 × 27 = 189 N + M = 7\times 27 = 189 , N = 113 N = 113 is too large.

Conclusion : We found only one solution, the pair 6 9 2 = 4761 , 4 2 2 = 1764. 69^2 = \boxed{4761},\ \ \ 42^2 = 1764.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...