2

Find all natural numbers $n$ where $n<1000$ such that cube of sum of the digits of $n$ be equal to $n^2$

For one digit numbers $n=1$ is the only answer. For two digits numbers $\overline{ab}$:

$$(10a+b)^2=(a+b)^3$$ $$100a^2+20ab+b^2=a^3+3a^2b+3ab^2+b^3$$

But it seems this method doesn't work because I can't simplify above equation.

Blue
  • 75,673
Etemon
  • 6,437
  • 2
    Brute force seems pretty attractive. Note that $S(n)$, the sum of the digits of $n$, satisfies $S(n)\equiv n\pmod 9$ so you need $n^3\equiv n^2\pmod 9$, which cuts the search down a lot. – lulu Jan 05 '21 at 15:11
  • 5
    $n^2$ is a perfect cube so $n$ is a perfect cube. – Neat Math Jan 05 '21 at 15:14
  • (Edited) Programming says the only solutions are $1$ and $27$ . – VIVID Jan 05 '21 at 15:17
  • 1
    @NeatMath Good point. That makes it a paper and pencil computation. – lulu Jan 05 '21 at 15:17
  • @NeatMath Probably, you should post an answer :) – VIVID Jan 05 '21 at 15:21
  • 2
    @VIVID no worries. Between my first comment, and Neat Math's, we only need to check $1^3, 3^3, 6^3, 9^3$ and it is easy to eliminate the last two. – lulu Jan 05 '21 at 15:21
  • @lulu Yes, this has been a nice hack :D – VIVID Jan 05 '21 at 15:22
  • @NeatMath I second the motion for you to post your solution. Personally, I tend to program things like this with little or no analysis (as the numbers are so small), but your comment makes this into something we can do mentally, which I find unexpected. – lulu Jan 05 '21 at 15:28
  • 1
    @lulu and VIVID Thanks guys. Whoever summarizes our discussion and writes a solution does a favor to the community and deserves an upvote. – Neat Math Jan 05 '21 at 16:27

1 Answers1

4

Use @lulu's notation for $S(n)$ to denote the sum of digits of $n$. Using @NeatMath's observation that $(S(n))^3 = n^2$, we see that $n$ is a perfect cube, so it suffices to check the set $\{1^3,2^3,\dots,9^3\}$, due to the constraint $n < 1000 = 10^3$. You might include $0$ if you have an affirmative answer to Is $0$ a natural number?. $0$ and $1$ are trivial solutions.

@lulu's criterion $n^3 \equiv n^2 \pmod9$ restricts the searching to $1^3$, $3^3$, $6^3$ and $9^3$ because if $\gcd(n,9) = 1$, then the cancellation law gives $n\equiv1\pmod9$.

$n$ $S(n)$ $(S(n))^3$ $n^2$
$1^3 = 1$ $1$ $1$ $1$
$3^3 = 27$ $2+7 = 9$ $9^3 = 729$ $729$
$6^3 = 216$ $2+1+6 = 9$ $9^3 = 729$ $46656$
$9^3 = 729$ $7+2+9 = 18$ $18^3 = 5832$ $531441$

Hence, there's only two solutions $1$ and $27$.