# How to find the units digit of 2^102

I'd like to answer this question without using a calculator.

My first instinct is to find a pattern in the value of $2^n$:

$2^1 \equiv 2$, $2^2 \equiv 4$, $2^3 \equiv 8$, $2^4 \equiv 6$, $2^5 \equiv 2,...$

So units digit form a set of $4$ digits: $2,4,8,6,2,4,8,6...$

Now I'm stuck, how do I know which digit to pick from the set above

As you can see, it repeats with period $4$. The units digit of $2^k$ thus depends on $k \pmod 4$. Can you find $102 \pmod 4$?

• By "(mod $4$)" Ross means the remainder of the integer division of the number by 4. – Dariel Rudt Oct 7 '17 at 3:00
• Thanks for the help. So the remainder is 2 —> 2^2 = 4. The units digit is 4. How would this apply if the remainder is 0 meaning a whole number ? – Cyzanfar Oct 7 '17 at 4:26
• It would be the same as remainder $4$, so $6$. If you follow your pattern all multiples of $4$ greater than $0$ end in $6$. There are often perturbations at the start like $2^0=1$. If you look at two digits you never again match $2^1=02$ You can see that all powers greater than $0$ need to be even, so cannot be $1$. – Ross Millikan Oct 7 '17 at 4:29

Because the period of the pattern is $4$, the units digit of $2^{102}$ is the same as that of $2^{102-4}=2^{98}$. Which is the same as that of $2^{98-4}=2^{102-2(4)}$. Use this idea and you shall see why we can say that because the remainder of 102 divided by 4 is 2, the answer is the same as the answer to the units digit of $2^2$.

You've made a good start; I'm sure you've noticed that the pattern $2,4,8,6,2,\ldots$ repeats every $4$ numbers. So then $2^5$ gives you the same answer as $2^1$ and $2^{5+4}$ or $2^{5+4+4}$. This must mean $2^{102}$ would give the same final digit as $2^{4+4+\ldots+4+?}$. So how many $4$'s can we fit into $102$? In other words, when does the sequence $4,8,12,16,\ldots$ surpass $102$? As Ross Millikan points out, this is the same as finding the remainder of $\frac{102}{4}$.

$2^{102}\pmod {10}\equiv 2^{2+10\times 10}\equiv 4\times (2^{10})^{10}\equiv 4\times (1024)^{10}\equiv 4\times 4^{10}\equiv 4\times (2^{10})^2\equiv 4\times (1024)^2\equiv 4\times 4^2\equiv 64\equiv 4$

If you want a general way of solving this problem you should look into Fermat's Little Theorem which states:

For a given integer $a$, $a^p \equiv a$ (mod $p$) for a prime number $p$. Or equivalently $a^{p-1} \equiv 1$ (mod $p$).

For your specific problem you could let $a=2$ and $p = 5$. Although you would ideally want to get equivalence modulo 10, in this case, you will be fine since $2^n$ is even for $n > 0$. Then you see that $2^4 \equiv 1$ (mod 5), so $2^{100} = {(2^4)}^{25} \equiv 1$ (mod 5). Therefore, $2^{102} = (2^{100})(2^2) \equiv 2^2 \equiv 4$ (mod 5). We now see that the units digits is $2^2 = 4$.