Prime Fields

Basic arithmetic operations work as usual, except that exponentiation should be written as follows

to make it more efficient. (This only matters for large exponents.)

> restart;

> 2&^63 mod 71;

5

The function Primitive(a(x)) mod p checks whether the polynomial a(x) is primitive.

That is, whether 1) it is irreducible and 2) x is primitive in the field Z_p[x]/a(x) .

When a(x) = x-b is linear it tells whether the integer b is primitive in the field Z/p.

> Primitive(x-2) mod 71;

false

> 2^35 mod 71;

1

> Primitive(x-7) mod 71;

true

> 7^6 mod 71; 7^10 mod 71; 7^35 mod 71;

2

45

70

>

>