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

2 Answers

+2 votes
 
Best answer
Units digit of 4^1= 4 , Units digit of 4^2 =6 , Units digit of 4^3 is 4 and Units digit of 4^4 is 6(follows pattern 4,6,4,6,4,6…..)
Hence for 4^x , if(x%2==0 && x) ans =6 ; else if(x%2) ans =4; else ans=1;

So for 2^100 which is 4^50 the units digit(ans) is 6
by AlgoMeister (876 points)
selected by
+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)
The Book: Analysis and Design of Algorithms | Presentations on Slideshare | Lecture Notes, etc
...