What is the sum of all four-digit numbers that are equal to the cube of the sum of their digits (leading zeros are not allowed)?
Solution
We want to find all integers between 1000 and 9999 that are the cube of the sum of their digits. Of course, our search is only restricted to perfect cubes. The smallest such cube is and the largest such cube is . This means we only have to check 12 different cubes, which is quite doable, but we can reduce the search even further with a little number theory. Suppose we write our number as , where , and are the decimal digits of . Then we have If we let , then must be a solution to the modular equation . A quick check of the values 0 through 8 shows that the only solutions are 0,1 , and 8 . Now, in our search, we only have to check values that are the cube of a number which is either 0,1 , or . So the only solutions are 4913 and 5832 , which sum to 10745 .