I want to calculate
14^(2017^2017) mod 60
I know that 14 and 60 is not GCD=1, so I can not solve this with phi-function directly.
I also tried to split 60 into prim-factors (2^2, 3, 5). Here I know that it is possible to solve
14^(2017^2017) mod 3
14^(2017^2017) mod 5
with the phi function, but
14^(2017^2017) mod 2^2
is still not possible because GCD(14,4) = 2