I was working on a problem about cubes but I kept on getting stuck on some cases because for some moduli, for example 10, there are no impossible residues. For modulo 10:
\begin{array} .N & N^3\pmod{10} \\\hline 1 & \hfill 1 \hfill\\ 2 & \hfill 8 \hfill\\ 3 & \hfill 7 \hfill\\ 4 & \hfill 4 \hfill\\ 5 & \hfill 5 \hfill\\ 6 & \hfill 6 \hfill\\ 7 & \hfill 3 \hfill\\ 8 & \hfill 2 \hfill\\ 9 & \hfill 9 \hfill\\ 0 & \hfill 0 \hfill \end{array}
All the residues are used in the $N^3\pmod{10}$ table. Also for modulo $7$ all cubes are congruent to either $1$ or $-$1 modulo $7$. My question is whether there is a mathematical reason for why this is the case. Thanks
Yes, there is a mathematical reason. It's easiest to understand for prime moduli. Primes other than $3$ leave a remainder of $1$ or $2$ when you divide by $3$. Work out your tables for $p=5,7,11,13,17,19$ and you should see the pattern.
Fermat's Little Theorem will help you with a proof.
You can read about this at the beginning of the wikipedia page on cubic residues.