##
Find power of power under mod of a prime
February 22, 2017

Given four numbers A, B, C and M, where M is prime number. Our task is to find ABC (mod M). Input : A = 2, B = 4, C = 3, M = 23 Output : 6 243(mod 23) = 6 A Naive Approach is to calculate res = BC and then calculate Ares… Read More »