11.1 PrimeResidues

PrimeResidues( m )

PrimeResidues returns the set of integers from the range 0..Abs(m)-1 that are relatively prime to the integer m.

Abs(m) must be less than 2^{28}, otherwise the set would probably be too large anyhow.

The integers relatively prime to m form a group under multiplication modulo m, called the prime residue group. phi(m) (see Phi) is the order of this group, lambda(m) (see Lambda) the exponent. If and only if m is 2, 4, an odd prime power p^e, or twice an odd prime power 2 p^e, this group is cyclic. In this case the generators of the group, i.e., elements of order phi(m), are called primitive roots (see IsPrimitiveRootMod, PrimitiveRootMod).

    gap> PrimeResidues( 0 );
    [  ]
    gap> PrimeResidues( 1 );
    [ 0 ]
    gap> PrimeResidues( 20 );
    [ 1, 3, 7, 9, 11, 13, 17, 19 ] 

Up Top Next
Index

GAP 3.4.4
April 1997