Previous Page Next Page Contents

numlib::primroot -- primitive roots

Introduction

numlib::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.

Call(s)

numlib::primroot(m)
numlib::primroot(a, m)

Parameters

a - an integer
m - a natural number

Returns

numlib::primroot returns an integer or FAIL.

Related Functions

numlib::order

Details

Example 1

We compute the least positive primitive root modulo the prime number 40487:

>> numlib::primroot(40487)
                                     5

Example 2

We compute the least primitive root modulo 404872 = 1639197169:

>> numlib::primroot(1639197169)
                                    10

Example 3

Now we compute least primitive root modulo which is :

>> numlib::primroot(111111111,40487)
                                 111111116

Example 4

There are no primitive roots modulo 324013370:

>> numlib::primroot(324013370)
                                   FAIL

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000