up previous next
find a primitive root modulo a prime
PrimitiveRoot(P: INT): INT |
Find a primitive root modulo the prime
P
, i.e. a generator of
the cyclic multiplicative group of non-zero integers mod
P
.
Currently, the function produces the least positive primitive root.
/**/ PrimitiveRoot(17551561);
97
/**/ PrimitiveRoot(4111);
12;
|