0 votes
In other words, what is 2^100 mod 10
in Math Basics by AlgoMeister (1.6k points)

2 Answers

+1 vote
2^10 = 1024

So, 2^10 mod 10 = 4

2^100 = (2^10)^10.

So, 2^100 mod 10 = ((2^10) mod 10 ^ 10) mod 10

                              = (4 ^ 10) mod 10

                             = (2^10 mod 10 * 2^10 mod 10) mod 10
                             = (4 * 4) mod 10

                             = 6
by AlgoMeister (1.6k points)
reshown by
+1 vote

To begin with, 

We can calculate all the values of 2^n where 1 <= n <= 10. We get the values, 2, 4, 8, 16, 32, 64, 128, 256, 512, and 1024, respectively. 

We can notice a pattern in the last digit for all the numbers, the pattern follows 2, 4, 8, 6 for every 4 "n" values. 

Now, we can predict the last digit of 2^100 based on the noticeable pattern from above. Since the last digits of 2^n follow the repeating cycle of 2, 4, 8, 6 every four terms, we can reduce the exponent modulo 4 to get where 100 falls in the cycle. 

Here is how we can do that, 100 mod 4 = 0.

Since the remainder is 0, 2^100 corresponds to the last digit of 2^4, 6. Thus, the last digit of 2^100 is 6. 

by (128 points)
The Book: Analysis and Design of Algorithms | Presentations on Slideshare | Lecture Notes, etc
...