Here's my approach,
Let $a \in \mathbb{Z}$, from division algorithm, therefore $a$ is of the form of $ 8k + r, \, 0≤r<8$
I then obtained $8$ cases from this, and cubed all of them, factored $8$ out.
I obtained, $0,1,3,5,7$ as the only possible remainders when $a^3$ is divided by $8$.
I'm not sure if my answer is correct or not?
Can anyone show me how do you actually solve these types of question. I don't think applying Division Algorithm each every time is convenient, especially when divisor is a big number. I almost lost all my patience just trying to solve this.
So how do you go about solving this anyway? Also, is my method and answer correct?
Here's a sketch of how I would do it:
An integer $n$ is congruent to $0,1,\dots,6$ or $7$ modulo $8$.