To find (5^13)mod77, first divide the problem as follows:
(5*5*5*...*5)mod77
take 5 in pairs of three , and leaves a single 5. Let t=(5*5*5)mod77=125mod77=48
=> The result becomes:= (t*t*t*t*5)mod77
Now we know (a*b)mod c = ((amod c)*(bmod c))mod c
=> (48mod77*48mod77*48mod77*48mod77*5mod77)mod77
=>((-29)*(-29)*(-29)*(-29)*5)mod77
Find out ((-29)*(-29))mod77 = (841)mod77 = 71
Now the problem is reduced to (71*71*5)mod77 {71mod77 is -6}
so the result is (-6*-6*5)mod77 = 180mod77 = 26.