numtheory(deprecated)
primroot
compute a primitive root
Calling Sequence
Parameters
Description
Examples
primroot(g, n)
primroot(n)
g
-
positive integer or 0
n
integer greater than 1
Important: The numtheory package has been deprecated. Use the superseding command NumberTheory[PrimitiveRoot] instead.
The function primroot will compute the first primitive root of n that is greater than g, if possible, otherwise it returns FAIL. The integers that are relatively prime to n form a group of order φ⁡n under multiplication mod n. If this group is cyclic then a generator of the group is called a primitive root of n (i.e. the order of primroot (g, n) is φ⁡n). If only one argument n is present (in this case g=0) then this function will return the smallest primitive root of the number n.
The command with(numtheory,primroot) allows the use of the abbreviated form of this command.
with⁡numtheory:
primroot⁡2
1
primroot⁡41
6
primroot⁡0,41
primroot⁡7,41
11
order⁡,41
40
φ⁡41
primroot⁡2,8
FAIL
See Also
NumberTheory[PrimitiveRoot]
numtheory(deprecated)[order]
numtheory(deprecated)[pprimroot]
Download Help Document