Find the number of positive integers that are equal to the sum of the squares of their digits.
For example, does not have this property, since
Bonus: Explain and share your approach with others!
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.
First Step : Let us consider a single integer. There are digits ranging from 0 to 9, of which 1 is the obvious answer considering the conditions imposed by the question. Okay, let's move to the second step.
Second Step : Let us consider double digit integers. There are integers ranging from 10 to 99. We have to find whether the two digit number supports the conditions imposed or not.
1 0 x + y = x 2 + y 2 = 1 0 y + x . . . . . . . . . . . . . . . . . . . . . . . . e q . 1 where x,y are single digit integers. In case you are wondering why is 1 0 x + y = 1 0 y + x , just think if the middle expression holds true then this would be quite obvious.
On solving 1 0 x + y = 1 0 y + x we can conclude that x = y . . . . . . . . . . . . . . . . . . . . . . . . e q . 2 .
Solving eq.2 in eq.1, we get 2 y 2 = 1 1 y which is never possible for an integer. So two digit numbers are not possible at all which satisfy the given conditions.
Intermediate Step : One must also realize from eq.1 that this condition satisfies only permuations of digits of a satisfying integer. Maximum sum is 8 1 + 8 1 + 8 1 = 2 4 3 , therefore 4 digit numbers will not exist at all.
Third Step : Let us consider triple digit integers. There are integers ranging from 100 to 999. We have to find whether the two digit number supports the conditions imposed or not.
1 0 0 z + 1 0 x + y = x 2 + y 2 = 1 0 0 y + 1 0 x + 1 0 0 z = 1 0 0 z + 1 0 y + x = 1 0 0 y + 1 0 z + x = 1 0 0 x + 1 0 y + z = 1 0 0 x + 1 0 z + y . . . . . . . . . . . . . . . . . . . . . . . . e q . 3 where x,y,z are single digit integers.
Solving the different parts will give us an equation similar to eq.1 hence three digit numbers are not possible at all which satisfy the given conditions.
The answer is : 1