numlib::primroot
-- primitive
rootsnumlib::primroot
(m)
returns the least
positive primitive root modulo m
if there exist primitive
roots modulo m
.
numlib::primroot
(a, m)
returns the least
primitive root modulo m
not smaller than a
if
there exist primitive roots modulo m
.
numlib::primroot(m)
numlib::primroot(a, m)
a |
- | an integer |
m |
- | a natural number |
numlib::primroot
returns an integer or FAIL
.
numlib::primroot
returns FAIL
if there exist no primitive roots
modulo m
.numlib::primroot
returns the function call with
evaluated argument(s) if at least one argument is not a number.numlib::primroot
returns an error if the arguments
evaluate to numbers which are not both of the correct type.We compute the least positive primitive root modulo the prime number 40487:
>> numlib::primroot(40487)
5
We compute the least primitive root modulo 404872 = 1639197169:
>> numlib::primroot(1639197169)
10
Now we compute least primitive root modulo which is :
>> numlib::primroot(111111111,40487)
111111116
There are no primitive roots modulo 324013370:
>> numlib::primroot(324013370)
FAIL
numlib::primroot
uses ifactor
.