
3. For any natural number $n$, expressed in base 10, let $S(n)$ denote the sum of all digits of $n$. Find all natural numbers $n$ such that $n^{3}=8 S(n)^{3}+6 n S(n)+1$.


Solution: We write the given condition as

$$
n^{3}+(-2 S(n))^{3}+(-1)^{3}=3 \times n \times(-2 S(n)) \times(-1)
$$

This is in the form $x^{3}+y^{3}+z^{3}=3 x y z$. We know that this can happen if and only if $x+y+z=0$. Thus we obtain a simpler condition

$$
n-2 S(n)-1=0
$$

Again we know that $n-S(n)$ is divisible by 9 . Hence 9 should divide $S(n)+1$. It is easy to see that the number of digits in $n$ cannot be more than 2 . For a three digit number maximum value of $S(n)$ can be 27 and $2 S(n)+1 \leq 55$.. Hence $n$ is either a 1-digit number or a two digit number. Hence $S(n) \leq 18$. Since 9 divides $S(n)+1$, we can have $S(n)=8$ or $S(n)=17$. But then $n=17$ or $n=35$. Among these $n=17$ works but not $35 .(S(35)=8$ and $2 S(n)+1=17 \neq 35$.) Hence the only solution is $n=17$.
