numbers (version 0.7-5)

isPrimroot: Primitive Root Test

Description

Determine whether g generates the multiplicative group modulo p.

Usage

isPrimroot(g, p)

Arguments

g

integer greater 2 (and smaller than p).

p

prime number.

Value

Returns TRUE or FALSE.

Details

Test is done by determining the order of g modulo p.

Examples

Run this code
# NOT RUN {
isPrimroot(2, 7)
isPrimroot(2, 71)
isPrimroot(7, 71)
# }

Run the code above in your browser using DataLab