How do I compute modular powers in Sage?
To compute
in Sage, type
sage: R = Integers(97) sage: a = R(51) sage: a^2006 12
Instead of R = Integers(97)
you can also type
R = IntegerModRing(97)
. Another option is to use
the Sage interface with GMP:
sage: 51.powermod(99203843984,97) 96
See About this document... for information on suggesting changes.