<s>[INST] Find the units digit of $572^{42}$ The idea of this exercise is that you use the modulus to get the right answer.
What I did was:
$$572\equiv 2\pmod {10} \\
572^2 \equiv 2^2  \equiv 4\pmod{10} \\
572^3 \equiv 2^3  \equiv 8\pmod{10} \\
572^4 \equiv 2^4  \equiv 6\pmod{10} \\
572^5 \equiv 2^5  \equiv 2\pmod{10} \\
572^6 \equiv 2^6  \equiv 4\pmod{10} \\
(...)$$
I can see that this goes 2,4,8,6 and then repeats. I remember that the gist of the exercise is to find the remainder based on this repetition. How do I do that? I know that $572^{42} \equiv 2^{42}\equiv ? \pmod {10}$. How do I simplify that 42 and answer this using that repetition?
 [/INST] Notice the pattern in the indices, the indices that get mapped to each of $2,4,8$ or $6.$
Note that the indices $1,5,9,\cdots, 1+4n$ get mapped to $2.$ The indices $2,6,10,\cdots,2+4n$ to $4,$ the indices $3,7,11,\cdots 3+4n$ get mapped to $8,$ and finally all multiples of $4,$ of the form $4n$ get mapped to $6,$ where $n$ is a nonnegative integer.
Then you only need reduce $42$ modulo $4,$ which shows you that it is of the second form. Thus, you have that to the $42$nd power, your number is $4\pmod {10}.$
</s>