The smallest integer whose digit sum is larger than that of its cube?

233 Views Asked by At

79 is an example of a number whose digital sum is greater than that of its square (6241). Which is the least number, if any, whose digital sum is greater than that of its cube?

1

There are 1 best solutions below

12
On BEST ANSWER

The least number having the desired property, is $587$. I found it with PARI/GP.

First of all, I defined the function $ds$ :

ds(n)={s=0;while(n>0,s=s+component(Mod(n,10),2);n=truncate(n/10));s}

Then, I simply searched the least example :

n=1;while(ds(n)<=ds(n^3),n=n+1);print(n)

Furthermore, I searched the least examples for squares and $4th$ powers :

? for(k=2,4,n=1;while(ds(n)<=ds(n^k),n=n+1);print(k,"  ",n))
2  39
3  587
4  124499