#### Got a credit card? use our Credit Card & Finance Calculators

Thanks to Howard,bruncher,SalvorHardin,tea42,yyuryyub, for Donating to support the site

## Roots

cinelli
Lemon Slice
Posts: 460
Joined: November 9th, 2016, 11:33 am
Has thanked: 186 times
Been thanked: 129 times

### Roots

I was chatting to a friend about maths and she came up with the surprising assertion that people make too much of a fuss about calculating cube roots. “Take 512 for instance,” she said. “All you have to do is add the digits – 8 – and there you are: the cube root of 512 is 8.” I raised my eyebrows in disbelief. “Or take another example. Add the digits of 17576 to give 26 as the cube root.” I thought she was being rather selective in her examples, but didn’t press the point. Can you find all cases where the cube root of a number is the sum of its digits?

Cinelli

9873210
Lemon Slice
Posts: 702
Joined: December 9th, 2016, 6:44 am
Has thanked: 166 times
Been thanked: 204 times

### Re: Roots

cinelli wrote:Can you find all cases where the cube root of a number is the sum of its digits?

Yes

Dod101
The full Lemon
Posts: 12261
Joined: October 10th, 2017, 11:33 am
Has thanked: 2979 times
Been thanked: 5386 times

### Re: Roots

cinelli wrote:I was chatting to a friend about maths and she came up with the surprising assertion that people make too much of a fuss about calculating cube roots. “Take 512 for instance,” she said. “All you have to do is add the digits – 8 – and there you are: the cube root of 512 is 8.” I raised my eyebrows in disbelief. “Or take another example. Add the digits of 17576 to give 26 as the cube root.” I thought she was being rather selective in her examples, but didn’t press the point. Can you find all cases where the cube root of a number is the sum of its digits?

Cinelli

It sounds like one of these 'Can you find all the prime numbers?' sort of question. I should imagine that a computer ap could help but whether even it could find 'all' the cases I very much doubt.

Dod

9873210
Lemon Slice
Posts: 702
Joined: December 9th, 2016, 6:44 am
Has thanked: 166 times
Been thanked: 204 times

### Re: Roots

Dod101 wrote:
It sounds like one of these 'Can you find all the prime numbers?' sort of question. I should imagine that a computer ap could help but whether even it could find 'all' the cases I very much doubt.

Dod

If A, a positive integer, has N digits, we know it is > 10^(N-1)
The sum of the digits is < 10*N
so A is < 10^3*N^3

We know that exponentials grow faster than powers so there for large numbers there is no solution.
A fairly loose bound is that there are no solutions with 7 or more digits.

This leaves only 100 cases to test, which is well within the bounds of paper and pencil, let alone spreadsheets.
If using paper and pencil it would be worth tightening the bound to save effort.

SteelCamel
2 Lemon pips
Posts: 156
Joined: February 15th, 2017, 5:49 pm
Been thanked: 76 times

### Re: Roots

9873210 wrote:This leaves only 100 cases to test, which is well within the bounds of paper and pencil, let alone spreadsheets.

Indeed, but doing so raises two additional interesting questions. There are seven such numbers - the cubes of 0, 1, 8, 17, 18, 26 and 27. There's no reason I can see why those should be the ones that work, though.

More intriguingly, in every other case the process returns an incorrect answer - but not just any answer. The sum of digits differs from the correct cube root by a multiple of 3 in every case I've tried (including the above - zero is a multiple of 3). But is this the case for every number? And if so why?

9873210
Lemon Slice
Posts: 702
Joined: December 9th, 2016, 6:44 am
Has thanked: 166 times
Been thanked: 204 times

### Re: Roots

SteelCamel wrote:
9873210 wrote:This leaves only 100 cases to test, which is well within the bounds of paper and pencil, let alone spreadsheets.

Indeed, but doing so raises two additional interesting questions. There are seven such numbers - the cubes of 0, 1, 8, 17, 18, 26 and 27. There's no reason I can see why those should be the ones that work, though.

More intriguingly, in every other case the process returns an incorrect answer - but not just any answer. The sum of digits differs from the correct cube root by a multiple of 3 in every case I've tried (including the above - zero is a multiple of 3). But is this the case for every number? And if so why?

Mod 3 arithmetic.

10 mod 3 = 1
a^3 mod 3 = a mod 3

so
sum( a_n * 10^n ) mod 3 = sum( a_n) mod 3
(sum a_n)^3 mod 3 = sum( a_n) mod 3

so yes true for every number.

Let me know if I need to be more specific at step 2.

cinelli
Lemon Slice
Posts: 460
Joined: November 9th, 2016, 11:33 am
Has thanked: 186 times
Been thanked: 129 times

### Re: Roots

9873210 and SteelCamel have the right method and solution. You can further reduce the amount of searching by tabulating the digital roots of numbers and their cubes:

`d(n) d(n^3)1      12      84      94      15      86      97      18      89      9`

d(n^3) and the sum of digits is very close – in fact they differ by a multiple of 9. Only three satisfy the criterion that d(n) = d(n^3) so in any trial and error search, we can immediately rule out two thirds of candidates. Searching numbers up to 99 gives 1, 8, 17. 18, 26 and 27. There are surprisingly few solutions and it is easy to convince oneself that larger numbers are not feasible.

Cinelli

9873210
Lemon Slice
Posts: 702
Joined: December 9th, 2016, 6:44 am
Has thanked: 166 times
Been thanked: 204 times

### Re: Roots

Up thread I said 100 was a loose upper bound. I use a loose bound because I'm lazy. If I'm lazy in a different way (because I have to do a manual search) we can show there are no 6 digit solutions. In the last 40 years computers have really changed what is consider a tractable search space.

(6*9)^3 = 157464 so for any six digit solution the first digit must be 1.
(5*9+1)^3 = 97336 which is only five digits.

So we can reduce the search space to [0,46]

Also you neglected zero. A perfectly good integer, and a fine solution for this problem. Time to leave the FORTRAN, religious persecution, and other baleful influences from the dark ages behind.