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?
Asked
Active
Viewed 250 times
5
Bart Michels
- 26,985
- 6
- 59
- 123
Bernardo Recamán Santos
- 1,162
-
Was this a problem you "invented" yourself, or were you asked this by someone else? I find the generalizations of this interesting. – Jeppe Stig Nielsen Aug 18 '15 at 15:20
-
It came up in a discussion with my colleagues of Colombia Aprendiendo, a recreational mathematics group. Don´t think the question is new. – Bernardo Recamán Santos Aug 18 '15 at 18:46
-
(your last comment) Yes! (That is a typo for A064209.) – Jeppe Stig Nielsen Aug 19 '15 at 07:04
-
Freddy Barrera has pointed out that the solution is sequence A064209 in the OEIS. (Corrected) – Bernardo Recamán Santos Aug 19 '15 at 11:45
1 Answers
3
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
Peter
- 86,576
-
1
-
I'm horribly tempted to turn this into a Rosetta Code-style page, with lots of answers in different languages. Mathematica admits a particularly neat solution. – Patrick Stevens Aug 18 '15 at 13:48
-
1I wonder for which exponents $k$ this can be solved. I.e. for what positive integers $k$ can we find a positive integer $n$ such that the digital sum of $n$ exceeds the digital sum of $n^k$? – Jeppe Stig Nielsen Aug 18 '15 at 14:01
-
I currently search for the $5th$ power. The least example, if it exists, seems to be rather high! I think, there is a solution for any $k$, but this is, at the moment, only an intuitive guess. And the sequence of the least numbers seems to grow very fast. – Peter Aug 18 '15 at 14:05
-
@Peter: I'd be shocked if that were true. If we raise a natural number to the 1000th power, it gains at least three hundred digits. Not many of them need to be nonzero to outweigh the original number. (The 300 figure goes up rapidly with the size of the input.) – Patrick Stevens Aug 18 '15 at 15:21
-
@PatrickStevens If we go to a higher "radix" $b$, and define the digit sum in base $b$ in the obvious way, then it becomes easier to find examples. For example in base $314$, the number $578_{10}$ is $(1)(264){314}$, with digit sum $265{10}$, and its fifth power $64511804814368_{10}$ reads $(21)(42)(68)(75)(27)(22){314}$ with digit sum $21+42+68+75+27+22=255{10}$. So maybe the set of possible exponents $k$ is finite for each fixed radix $b$, but any $k$ is permissible if we take large enough $b$. This is pure guessing. – Jeppe Stig Nielsen Aug 18 '15 at 15:53
-
@PatrickStevens and others, I asked this as a separate question (should appear in "Linked" threads at the right). – Jeppe Stig Nielsen Aug 18 '15 at 19:01
-
@MartinR I just found out (from A261439) that
sumdigts(n)is a built in function in PARI/GP. Makes the search faster. – Jeppe Stig Nielsen Aug 18 '15 at 19:31 -
-
-
Sorry, I had a typo. It is
sumdigits. I do not know what version of PARI/GP it requires. But it makes your code a lot faster. Only supports base 10, though. – Jeppe Stig Nielsen Aug 20 '15 at 08:02 -
This does not work either. But I found an improvement : I stop when the momentary digitsum of the power is at least the digitsum of the number. With this improvement, I searched upto $4\times 10^9$ and found no example for $k=5$. – Peter Aug 20 '15 at 13:23