$3^1$=3 $3^2$ =9 $3^3$=27 $3^4$=81 (Last digits are 3,9,7,1)
$3^5$=243 $3^6$=729 $3^7$=2187 $3^8$=6561 (Last digits are 3,9,7,1)
$3^9$=19683 and so on…
Observe that for 3 power’s interval of 4, the last digits repeat from 3.
So given power of 3 is 51: 4*12=48. Now from 3’s power 49, the last digit will start from 3.
$3^{49}$ =last digit is 3
$3^{50}$ =last digit is 9
$3^{51}$ =last digit is 7
So $3^{51}$=______7 mod 5 = 2.