Third Millennium International Mathematical Olympiad 2009
Grades 9-10 (Problem 5)

  Find on all natural numbers that equal the sum of squares of their digits.

Solution by Clement Lau (Grade 9), Temple City, CA, USA.
Solution by Polina Viro (Grade 10), Stony Brook, NY, USA.

|Up| |Contact| |Front page| |Contents|

Copyright © 1996-2018 Alexander Bogomolny

The sum of the squares of the digits 299 is 164. The only number in the 300s whose sum of the squares of its digits exceeds that of 299 is 399. The sum goes up only 5, while the number goes up 100. Therefore, no number greater than 299 can possibly have the property of it equaling the sum of the squares of its digits. The sum of the squares of the digits of 199 is 163. Since the sum of the squares of the digits of any number less than 199 is less than 163, it is impossible to have a number with the property described above that is greater than 163. Of the set of numbers between 1 and 163, the number whose sum of the squares of its digits is greatest is 159. The sum of the squares of its digits is 107. Therefore, it is impossible to have a number greater than 107 that has the property described above. Between 100 and 107, inclusive, the number with the greatest sum of the squares of its digits is 107, which is 50. Therefore, none of these numbers can possibly have the property described above. Any natural number with the property must either be a two digit or one digit number.

The sum of the squares of the digits of a X will henceforth be abbreviated to &X.

&93 = 90, &94 = 97, &97 = 130. &(any number between 94 and 97) is greater than 97. &(any number in the 90s greater than 97) is greater than 130. &(any number in the 90s less than 93) is less than 90. Therefore, no numbers with the property described above is in the 90s.

&84 = 80, &85 = 89. &(any number in the 80s greater than 85) is greater than 89. &(any number in the 80s less than 84) is less than 80.

Therefore, no numbers with the property described above is in the 80s.

&75 = 74, &76 = 85. &(any number in the 70s greater than 76) is greater than 85. &(any number in the 70s less than 75) is less than 74.

Therefore, no numbers with the property described above is in the 70s.

&65 = 61, &66 = 72. &(any number in the 60s greater than 66) is greater than 72. &(any number in the 60s less than 65) is less than 61. Therefore, no numbers with the property described above is in the 60s.

&55 = 50, &56 = 61. &(any number in the 50s greater than 56) is greater than 61. &(any number in the 50s less than 55) is less than 50. Therefore, no numbers with the property described above is in the 50s.

&45 = 41, &46 = 52. &(any number in the 40s greater than 46) is greater than 52. &(any number in the 40s less than 45) is less than 41. Therefore, no numbers with the property described above is in the 40s.

&34 = 25, &35 = 34, &36 = 45. &(any number in the 30s greater than 36) is greater than 45. &(any number in the 30s less than 34) is less than 25. Therefore, no numbers with the property described above is in the 30s.

&24 = 20, &25 = 29. &(any number in the 20s greater than 25) is greater than 29. &(any number in the 20s less than 24) is less than 20. Therefore, no numbers with the property described above is in the 20s.

&13 = 10, &14 = 17, &17 = 50. &(any number between 14 and 17) is greater than 17. &(any number in the 10s greater than 17) is greater than 50. &(any number in the 10s less than 13) is less than 10. Therefore, no numbers with the property described above is in the 10s.

For any one digit number, since it has only one digit, the square of its digits is the square of the number itself. Therefore, of the one digit numbers, only 1 equals the sum of the square of its digit.

In summary, of the natural numbers, only 1 is equal to the sum of the square of its digit.

|Up| |Contact| |Front page| |Contents|

Copyright © 1996-2018 Alexander Bogomolny

Let

  b = 10nan + 10n-1an-1 + ... + 100a0

(where 0 ≤ ak < 10 and an ≠ 0) be the number we are looking for. Because the sum of squares of its digits is b, we can conclude that

  b = 10nan + 10n-1an-1 + ... + 100a0 = an2 + an-12 + ... + a02.

Therefore,

(*) an(an - 10n) + an-1(an-1 - 10n-1) + ... + a0(a0 - 1) = 0.

Let us look at ak(ak - 10k). If k > 0 and ak isn't equal to 0, we have a negative number (because if ak - 10k > 0 then ak > 10k therefore ak > 10 (which isn't possible because 0 < ak < 10, so the statement ak - 10k >0 is false and ak - 10k is a negative number).

If k = 0, we have a0(a0 - 1). Its possible vaules are 0, 2, 6, 12, 20, 30, 42, 56, 72.

To make the eqation (*) true when some ak(ak - 10k) isn't 0, for k > 0, we see that a0(a0 - 1) = -ak(ak - 10k) (because ak(ak - 10k) as proven above is negative, and the only positive ak(ak - 10k) is when k = 0).

Assume that for some k > 1, ak isn't equal 0. Then the largest vaule ak(ak - 10k) can take is -99 (when k = 2 and ak = 1). As seen before, the max value of a0(a0-1) = 72, therefore the equation (*) isn't satisfied, so for any k > 1, ak = 0.

If k = 1, a1(a1 - 10) can take the following vaules: -9, -16, -21, -24, -25. As we see, a1(a1 - 10) can't be equal to a0(a0 - 1) (as we see from the possible values that a1( a1 - 10) and a0(a0 - 1) can take). Therefore, if k = 1, ak = 0.

If k = 0, the possible vaules for ak(ak - 10k) = a0(a0 - 1) are either positive or 0. Because as we've seen before, k = 1, ak = 0, so therefore a0(a0 - 1) = 0 needed to satisfy equation (*).

a0(a0 - 1) = 0
a02 = a0
a0 = 1

Therefore, the only possible solution for eqation (*) is when ak = 0 (for all k > 0) and a0 = 1. Therefore, the only possible value for b is 1.

Answer: 1.

|Up| |Contact| |Front page| |Contents|

Copyright © 1996-2018 Alexander Bogomolny

71546796