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$.