To begin, find the remainder when 54 is divided by 17.
R(54/17) = 3. So our question can be reduced to what is the remainder when 3^124 is divided by 17.
Let us look for the cyclicity then.
R(3/17) = 3
R(9/17)=9
R(27/17)=10
R(81/17)=13
R(243/17) = 5
R(729/17)=15
R(2187/17)=11
R(6561/17)=16
R(19683/17)=14
R(59049/17)=8
R(177147/17)=7
R(531441/17)=4
R(1594323)=12
R(4782969/17)=2
R(14348907/17)=6
R(43046721/17)=1
R(387420489/17)=3
Finally, we have a cycle with cyclicity 16. So Remainder of 3^124 divided by 17 will be equal to 3^Remainder of 124/16 divided by 17.
R(124/16) = 12
So R(3^12)/17 =4
Hence Answer will be
4Now a trick to solve this kind of question. The maximum cyclicity a unit digit has is 4 and the maximum cyclicity a remainder can have is 16. So instead of doing this calculation, we can safely use 16 as cyclicity and all the remainders with cyclicity of 4 and 8 will also have a cyclicity of 16.
_________________
Satish Sharma
-------------------------
Strive for Excellence