Sum of cubes of the digits of a number equal to the number

22.2k Views Asked by At

I have a number, I don't know how large or small, but if I cube the digits of the number and sum them, the sum is equal to the number itself. In other words, $$\sum_{k=1}^n{a_k^3}=\sum_{k=1}^{n}{a_k 10^{k-1}}$$ I know a couple of answers just by guess and check, but I'd rather have a concrete way. I know by some simple analysis that the number can't be a two digit number since $$a^3+b^3=10a+b \Rightarrow a^3-10a=b-b^3 \Rightarrow a(a^2-10)=b(1-b^2)$$ So $b^2$ can either be 0 or 1, but that produces either a $0$ or $1$ for a and that doesn't work (the trivial solutions are of course $0^3=0$ and $1^3=1)$. So the number must be at least three digits. Also, since $$9^3+9^3+9^3+9^3+9^3=5(729)=3,645$$ The number can at most be 4 digits. So from here, $$a^3+b^3+c^3=100a+10b+c$$or$$a^3+b^3+c^3+d^3=1,000a+100b+10c+d$$ By guess and check I got 153 as one answer $(1^3+5^3+3^3=1+125+27=153)$. But I know there are 11 more solutions and I'm not guessing them all. Outside writing a program to extract them, how can I solve the two equations above to get he remaining solutions (not sure if the question I'm solving includes the trivial solutions or not,so there might only be 9 more)?