What will be the remainder when $2^{31}$ is divided by $5$? The question is given in the title:

Find the remainder when $2^{31}$ is divided by $5$.

My friend explained me this way:

$2^2$ gives $-1$ remainder.
So, any power of $2^2$ will give $-1$ remainder.
So, $2^{30}$ gives $-1$ remainder.
So, $2^{30}\times 2$ or $2^{31}$ gives $3$ remainder.

Now, I cannot understand how he said the last line. So, please explain this line.
Also, how can I do this using modular congruency?

Notice the pattern.
2 divided by 5 remainder is 2.
4 divided by 5 remainder 4.
8 divided by 5 remainder 3.
16 divided by 5 remainder 1.
For 32 it is 2 again , 64 - 4, 128 - 3, 256- 1 and so on.  
So for 2 to the power 31 -
Remainder is 2 for the power 29 and 3 for the power 31.
