WOLFRAM|DEMONSTRATIONS PROJECT

Powers Modulo m

​
k
4
n
2
n
k
≡c(modm)
if
m
is a divisor of
n
k
-c
or, equivalently, if the remainder when
n
k
is divided by
m
is
c
. The number
c
is called the residue of
n
k
(modm)
. This Demonstration shows all the residues of
n
k
(modm)
for various values of
k
and
n
.