Use the division algorithm to establish that, The cube of any integer is either of the form $9k ,9k + 1, 9k + 8$. 
Use the division algorithm to establish that, The cube of any integer is either of the form $9k ,9k + 1, 9k + 8$.

Let $a$ is an integer, write $a = 9k + r, 0 \le r < 9$  hence $r = \{0,1,2,3,4,5,6,7,8\}$ then $$a^3 =(9k + r)^3 = 9(9k^3 + 3kr(9k +r )) + r^3, 0 \le r³ < 9$$
when $r=0 \to r^3 = 0$
when $r=1 \to r^3 = 1$
when $r=2 \to r^3 = 8$
when $r=3 \to r^3 = 27$
Since $0\le r^3 < 9$ above $8$ values cannot be accepted.  Hence $r^3\in{0,1,8}$. Hence $a^3$ can express in $a^3 = 9k, a^3 = 9k + 1, a^3 = 9k + 8$ forms. Therefore cube of any integer is form $9k, 9k + 1,$ or $9k + 8$.
Is this correct? Are there other solutions?
 A: *

*$a=3n\Longrightarrow a^3=(3n)^3=9\cdot(3n^3)\equiv0\pmod 9$

*$a=3n+1\Longrightarrow a^3=(3n)^3+3(3n)^2+3(3n)+1=9\cdot(3n^3+3n^2+n)+1\equiv1\pmod9$

*$a=3n+2\Longrightarrow a^3=(3n)^3+6(3n)^2+12(3n)+8=9\cdot(3n^3+6n^2+4n)+8\equiv8\pmod9$
A: This is a supplementary answer:
You want to be a little careful for why $27$ can be disregarded. Note that if $a=9k+27$ then $a=9(k+3)+0$. So what's really happening is that remainder $27$ can be rewritten to be remainder $0$. For example, consider what happens if you do $6$ instead of $9$.
Write $a=6k+r$ such that $0\leq r <6$. Then $a^3=6k'+r^3$ for some appropriate $k'$.
If $r=0$ then $r^3=0$.
If $r=1$ then $r^3=1$.
If $r=2$ then $r^3=8$.
If $r=3$ then $r^3=27$.
If $r=4$ then $r^3=64$.
If $r=5$ then $r^3=125$.
If I stopped after the first two and said that values above $5$ can be disregarded, then I might incorrectly conclude that the cube of any number can be written as $6k$ or $6k+1$ for some $k$. But in fact $8$ corresponds to remainder $2$ (mod $6$), $27$ to remainder $3$ (mod $6$), and $125$ to remainder $5$ (mod $6$).
So in fact cubes are represented by $6k$, $6k+1$, $6k+2$, $6k+3$, and $6k+5$.
