Once you’ve defined the variables a and p you can just do gap> a^p mod p = a mod p;
and gap> a^(p-1) mod p = 1; Or you can write a function ModuloExpressions := function(x, y, modulo) return x mod modulo = y mod modulo; end; where x and y are integers, and modulo is the mod you want to use, and then call it using gap> ModuloExpressions(a^p, p, p ); gap> ModuloExpressions(a^(p-1),p,1); Sandeep Murthy s.mur...@mykolab.com > On 16 Apr 2015, at 17:22, Wanderley Tiowann <sgwvie...@gmail.com> wrote: > > How can I do this on GAP? a^p = a (mod p) or a^(p-1) = 1 (mod p)? >
_______________________________________________ Forum mailing list Forum@mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum