powmod (or powermod takes as argument a,n,p. powmod (or powermod) returns an mod p in [0;p−1]. Input :
Output :
Input :