# Prove that no integer whose digits add up to 15 can be a square or a cube.

Prove that no integer whose digits add up to 15 can be a square or a cube.

Can someone explain step by step how to solve this proof. Thank you so much!

• Do you know the checking technique of casting out nines? You add up the digits repeatedly till you get a number less than nine (throwing away all appearances of $9$ while doing so). Your result is the (least) residue of your original number modulo $9$. Used to be taught in elementary school. – Lubin Apr 26 '14 at 21:04
• Is that where to see if something is divisible by 9 you add up all the digits in the number and see if it is divisible by 9? – Lil Apr 26 '14 at 21:10
• That’s exactly it, but it’s more than that, because if, when you’re adding a bunch of numbers, the sum of the residues isn’t congruent to the residue of the sum you got, you know for sure that you’ve made a mistake. – Lubin Apr 26 '14 at 23:45

Hint $\$ By casting nines, such integers are $\equiv 6\pmod 9.\,$ But $6$ is not a square or cube mod $9$.
• An integer is a multiple of $3$ iff its digit sum is a multiple of $3$.
• An integer is a multiple of $9$ iff its digit sum is a multiple of $9$.
• If a pefect power $n^k$ is divisible by the prime $p$, then $n$ itself is divisible by $p$ and hence $n^k$ is divisible by $p^k$.
You can show that every integer $\mod 9$ is the same as its sum of digits $\mod 9$, because $n10^k = n(\sum_{m=0}^{k-1}9*10^m + 1)$. So your number is $a \mod 9$ if and only if the sum of digits is $a \mod 9$, which is if any only if the sum of digits of the sum of digits is $a \mod 9$. In your case the sum of digits of the sum of digits is $6$. So you just need to compute the squares and the cubes of all $9$ values $\mod 9$ and verify that none of them are equal to $6 \mod 9$, and you're done.