whenever you come across a question like this :-- a number raised to higher power of integer divided by 2,3,4,5,6,7,8,9..
and asking for remainder...then, the question is actually asking for the unit digit of the numerator..
now,
3^4 has a unit digit of 1 => unit digit of 1 will repeat after every fourth power of 3.
6 to the power anything, always has a unit digit of 6
7^4 also has a unit digit of 1 => unit digit of 1 will repeat after every fourth power of 7
now, 151 = 148 + 3
7^148 * 7^3 = unit digit of 1 * unit digit of 3 = unit digit of 3..
any number divided by 5 gives remainder = unit digit of the number, when unit digit is less than 5
and (unit digit - 5) , when unit digit is greator than 5