According to Euclid's Division Lemma,
a = bq + r,
Let 'a' be any positive integer , then it is of the form 3q , 3q + 1, 3q +2
Here are the following cases ----
CASE I ---> When a = 3q
=>a = 3q
=> a^3 = (3q)^3
=> a^3 = 27q^3
=> a^3 = 9(3q^3) = 9m, where m = 3q^3
CASE II ---> When a = 3q + 1
=> a = 3q + 1
=> a^3 = (3q + 1)^3
=> a^3 = 27q^3 + 27q^2 + 9q + 1
=> a^3 = 9m + 1 ,
where m = q(3q^2 + 3q + 1)
CASE III ---> When a = 3q + 2
=> a = 3q + 2
=> a^3 = (3q + 2)^3
=> a^3 = 27q^3 + 54q^2 + 36q + 8
=> a^3 = 9m + 8 ,
where m = q(3q^2 + 6q + 4)
Therefore, a^3 is either of the form 9m, 9m + 1 or 9m + 8....