I was checking the following number theory excercise:
The number $1634$ has an interesting property. This 4-digit number satisfies that the sum of the fourth powers of its digits gives the same number. That is, $1 ^ 4 + 6 ^ 4 + 3 ^ 4 + 4 ^ 4$ $=$ $1634$. How many integers of $ m $ digits are equal to the sum of the $ m $ -th powers of their digits in the interval $[1, ..., 10 ^ 7]$? What is the largest of those complies with said property in the same interval?
I've found using some research that the numbers under the power of four are:
$$1634 = 1^4 + 6^4 + 3^4 + 4^4$$ $$8208 = 8^4 + 2^4 + 0^4 + 8^4$$ $$9474 = 9^4 + 4^4 + 7^4 + 4^4$$
As $1 = 1^4$ is not a sum it is not included.
So my biggest number is $9474$ in this moment.
Is there a bigger number than that or other number that that meets the condition of the statement in the interval provided?
Any help will be really appreciated
Use the following Java code:
Output:
Adjust LIMIT and you can proceed even further. Up to $10^9$: