# The last digit of $2^{2006}$

My 13 year old son was asked this question in a maths challenge. He correctly guessed 4 on the assumption that the answer was likely to be the last digit of $2^6$. However is there a better explanation I can give him.

• Because last digit of $2^5$ is 2, so last digit of $2^{2006}$ is last digit of $2\cdot 2^{401}$, and so on. – Hanul Jeon Jan 23 '13 at 9:25
• Note that $2^4\equiv 6 \bmod 10$ , $6^n\equiv 6 \bmod 10$ and the last digit is the no. mod 10. So $2^n\equiv 2^x\bmod 10$ if $x\equiv n \bmod 4$ 2006 mod 4=2 so the last digit is that of 4 – Ishan Banerjee Jan 23 '13 at 9:32
• I remember this exact problem from when I had math competitions many, many years ago... – enderland Jan 24 '13 at 2:28
• Let's say the last digit of $2^{2006} = x$ then $x \equiv 2^{2006} (mod 10)$, to solve this "reduce" the exponent checking or exponentiating 2 to some power that is a divisor of 2006 and also that you know and isn't too big. For example: $2^{2006}=4^{1003}=16^{500}4^3$ etc... Keep in mind that $16^{500}4^3 \equiv 6^{500}4^3 (mod 10)$, and also remember that you can't apply in this case Fermat-Euler's theorem because $(10,2)=2$. – Diego Robayo Sep 28 '14 at 0:42

$2^{4} = 16$. Multiply any even integer by $6$ and you don't change the last digit: $0 \times 6 = 0$, $2 \times 6 = 12$, $4 \times 6 = 24$ etc. The same is true if you multiply an even integer by anything whose last digit ends in $6$, in particular by $16$. Now $2006 = 2004 + 2$ where $2004 = 501 \times 4$, so $2^{2006} = (2^4)^{501} \times 2^2$ has the same last digit as $2^2$.

• Many thanks Robert – Keith Miller Jan 23 '13 at 9:49
• I don't find this particularly satisfying. "Multiply any even integer by 6 and you don't change the last digit." But how does that explain anything to the 13 year old? To them, that's just a bit of unexplained magic that they (probably) didn't know beforehand. – Beska Jan 23 '13 at 21:43
• For a $13$-year-old, is it better to say that $6 \equiv 1 \mod 5$ and $\equiv 0 \mod 2$ ...? I doubt it. – Robert Israel Jan 23 '13 at 21:54
• Multiple of 6: Assumption x * 6 = 10*u + x whereas x in {0,2,4,6,8} and u is unknown. Let's say x = 2*y for y in {0..4}. Then 2*y*6 = 2*y*5 + 2*y = 10*y + x. – user59502 Jan 24 '13 at 13:16
• Or more simple: x*6 = 5*x + x. Since x is even, 5*x contains at least one 10 in it's integer factorization and therefore 5*x won't affect the last digit. "+x" will be the only part which affects the last digit. – user59502 Jan 31 '13 at 7:19

Well, looking at successive powers of two, starting at $2^1$ we have $$2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, \dots$$

Now, looking at only the final digit we have $$2, 4, 8, 6, 2, 4, 8, 6, 2, 4, \dots$$

You may be able to guess that the pattern repeats the segment $2, 4, 8, 6$ forever. If you're correct, then you can work out the last digit by figuring where $2^{2006}$ sits in this pattern. Note that the first term in the sequence is $2$, and every four terms along it is also $2$. That is the $(4k+1)^{\textrm{th}}$ term is always $2$. Likewise, the $(4k + 2)^{\textrm{nd}}$ term is always $4$, the $(4k+3)^{\textrm{rd}}$ term is always $8$, and the $(4k+4)^{\textrm{th}}$ term is always $6$. Now you just need to figure out whether $2006$ is of the form $4k + 1, 4k+2, 4k + 3$, or $4k + 4$. As $2006$ is even, it is either of the form $4k+2$ or $4k+4$. As $4k+2 = 2006$ has an integer solution $(k = 501)$ and $4k + 4 = 2006$ doesn't, $2006$ is of the form $4k+2$ and therefore $2^{2006}$ ends in a $4$.

A guess is all well and good, but it ain't no proof. How do we know the pattern of digits continues to repeat forever (or at least up to $2006$)? Well, you can use modular arithmetic to prove the pattern continues, but if your son knew modular arithmetic, he could have used it to solve the problem in the first place.

Another way to see the pattern continues is to think about what happens when you multiply numbers. Consider multiplying the number $43$ by $2$. How do you do it? First you multiply $3$ and $2$ and put the result in the ones column, then you move onto the $4$ and multiply it by $2$ and put it in the tens column. Had we chosen $46$ instead of $43$ then it is slightly more complicated because $6\times 2 = 12$. In this situation we put the $2$ in the ones column and we carry the $1$ to the tens column. This all sounds a little bit boring but the point is this:

To find out the last digit of $a\times 2$, where $a$ could have lots of digits, we just need to know what (the last digit of $a$)$\, \times\, 2$ is. In particular, the last digit of $($(the last digit of $a$)$\, \times\, 2)$ is the same as the last digit of $(a\times 2)$.

This is true because of the way we multiply as explained above. When multiplying $43$ by $2$, we only put something in the ones column when we did $3\times 2$. In the case of $46$ multiplied by $2$, we get $6\times 2 = 12$ and put the $2$ in the ones column. So irrespective of the size of the number, we only put something in the ones column when we multiply the rightmost (i.e. last) digit by $2$, and in the case that the result has more than one digit, we only take the last digit of the result and put it in the ones column.

With this in mind, we have the final digits of the first four powers of $2$ are $2, 4, 8, 6$. As $6 \times 2 = 12$, we know that the final digit of $2^5 = 2^4\times 2$ is $2$. Then as $2\times 2$ we know that the final digit of $2^6 = 2^5\times 2$ is $4$. Then as $4\times 2= 8$ we know the final digit of $2^7 = 2^6\times 2$ is $8$. Then as $8\times 2 = 6$, we know that the final digit of $2^8=2^7\times 2$ is $6$. Now we're back to $6$ and can see that we will continue the pattern forever. So the initial guess was correct and hence the argument that $2^{2006}$ ends in a $4$ is valid.

Note, similar considerations to those made above can be used to show that the last digit of $a\times b$ is the same as the last digit of (last digit of $a$)$\, \times\,$(last digit of $b$). As before, you can also prove this using modular arithmetic.

• This is the answer I would have given. – Joe Z. Jan 23 '13 at 13:58

The number may be written as $$2^{2006}=4^{1003}$$ $4^1=4$
$4^2=4\times4=16$
$4^3=4\times4\times4=64$
$4^4=4\times4\times4\times4=256$
At this point we immediately see that if the power of $4$ is odd then the last digit is $4$ otherwise is $6$.

• How does this have 46 upvotes? This is a really common method?? – Katie Oct 23 '14 at 11:04
• @Katie Yeah, it is a common method for me. – user 1357113 Oct 23 '14 at 11:19
• Being a normal or common method doesn't mean one cannot like it. @Katie – Jasser Jan 26 '16 at 11:55
• @Jasser You believe this answer warrants 530 reputation points? About 46 of your answers worth of reputation. – Katie Feb 1 '16 at 9:06
• Well it certainly doesnt but people follow people I.e., when they see some answer with many upvotes they tend to upvote it.... and moreover most of the people will try to answer the question with $2$ instead of $4$.... and so they might have liked it since they could not think of it and I am one of them..... Also the question doesnt have to have so many upvotes and so do other answers.... but it just happens as I said..... – Jasser Feb 1 '16 at 15:35

If $a\equiv b\pmod n\implies a^m\equiv b^m\pmod n$

Thus, $2^5\equiv 2\pmod {10}\implies (2^5)^{400}\equiv 2^{400}\equiv2^{80}\equiv 2^{16}\equiv2^3.2\equiv 6\pmod{10}$

Therefore, $2^{2006}\equiv 2^{2000}.2^6\equiv6.4\pmod{10}\equiv 4\pmod{10}$

Hence, the unit digit is $4$

• I see this to be better & correct explanation than others – Ravia Jan 23 '13 at 14:56
• This is the best indeed – Applied mathematician Jan 23 '13 at 15:10

When doing modular exponentiation, Euler's Totient function ($\phi$) is quite handy.

To get the last digit of $2^{2006}$, we simply rewrite it as $x \equiv 2^{2006}\; (mod\;10)$.

For any modular exponentiation, we can express $a^b\;(mod\;c)$ more simply as $a^{b (mod\;\phi(c))}\;(mod\;c)$.

$\phi(10)=4$, therefore $2^{2006}\equiv2^{2006\:(mod\:4)}\equiv2^2\equiv4\;(mod\; 10)$

• While a very useful tool, using Euler's Theorem here sort of trivializes the problem. – Thomas Jan 23 '13 at 22:17
• Are you sure this is right? Sure, the answer is, but if I recall correctly Euler's theorem requires $\gcd(a,m)=1$ and says in that case $a^{\phi(m)}\equiv 1\pmod{m}$, but here we have $\gcd(2,10)=2\neq1$. Or am I missing something? The chinese remainder theorem could be applied here though: $2^{2006}\equiv 0 \pmod{2}$ and $2^{2006}\equiv 4 \pmod{5}$ and then apply Euclid's extended algorithm or just notice immediately that $4\equiv 0\pmod{2}$ and $4\equiv 4\pmod{5}$ (in the preceding steps I have applied Euler's theorem which was possible because 5 and 2 are prime.) – user50407 Jan 24 '13 at 14:04

The last digit of $2^{2006}$ is $2^{2006} (\text{mod }10)$. So let's look at the behavior of powers of $2$ mod $10$.

$2^2 = 4$, $2^3 = 8$ (nothing interesting so far), $2^4 = 16 = 6$ (remember we are working mod $10$, we only keep the last digit). $2^5 = 32 = 2$, Now THIS is interesting. This suggests we divide $2006$ by $5$.

So let's do that: $2006 = (401)(5) + 1$

going back to working mod $10$, we have:

$2^{2006} = 2^{(5)(401)+1} = (2^5)^{401}(2)= 2^{402}$ so we have knocked down the size of our exponent a great deal. Repeating this procedure again leads to:

$2^{402} = 2^{(5)(80) + 2} = (2^5)^{80}(2^2) = 2^{82}$ (still mod $10$).

Another go:

$2^{82} = 2^{(5)(16)+2} = (2^5)^{16}(2^2) = 2^{18}$ (mod $10$),

One last time:

$2^{18} = 2^{(5)(3)+3} = (2^5)^3(2^3) = 2^6$ We can stop now, it's clear that the last digit we are looking for is $4$ (the last digit of $64 = 2^6$). But if we wished (and we were for some reason unwilling to physically compute $2^6$) we could continue for one last step:

$2^6 = (2^5)(2^1) = (2)(2) = 4$ (mod $10$).

$4$ because $2\times 2\times\dots\times 2$ ($2006$ times); if number in power has remainder $0$, $1$, $2$, or $3$ when divided by $4$, then last digit is $6$, $2$, $4$ or $8$ respectively.

• I have slightly reworded your answer. If it is not what you meant and you want to change it back, please do so. – Michael Albanese Jan 24 '13 at 12:08