Let $a$ be any integer. Show that the last digit of $a^3$ can be any digit from 0 to 9.
We use the Division Algorithm to write integer $a$ as $a = 10q + r$ where $0 \le r < 10$.
We have
$$ \begin{align} a^3 & = 1000 q^3 + 300 q^2 r + 30 q r^2 + r^3 \\ \\ & \equiv 0 + 0 + 0 + r^3 \pmod {10} \\ \\ & \equiv r^3 \end{align}$$
We consider each case for $r$:
| r | r^3 | r^3 mod 10 |
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 8 | 8 |
| 3 | 27 | 7 |
| 4 | 64 | 4 |
| 5 | 125 | 5 |
| 6 | 216 | 6 |
| 7 | 343 | 3 |
| 8 | 512 | 2 |
| 9 | 729 | 9 |
This tells us the last digit of $a^3$ can be any digit from 0 to 9.