# Irreducible polynom over a finite field

Let's say i have $\mathbb F_{729}$, finite field generated by $a$ root of the polynom $x^6+x+2$ (on $\mathbb F_3$). The question is hot to find the minimal polynom of $\sigma=a^2$ (that has degree 6).
I know that should exist a command to do so, but i need to do that without it.
It's well know that this polynom is $(x-\sigma)(x-\sigma^3)(x-\sigma^9)(x-\sigma^{27})(x-\sigma^{81})(x-\sigma^{243})$
Now the problem is how to "reduce" this polynom (a thing with $a$), knowing that $a^6=2a+1$, in order to get my polynom with coefficent in $F_3$
Any ideas?

Could take the resultant of y-a^2 with the defining poly for root a.

Resultant[y - a^2, a^6 + a + 2, a, Modulus -> 3]

(* Out[74]= 1 + 2 y + y^3 + y^6 *)


Check that this reduces to 0 when y is substittued with a^2.

PolynomialReduce[1 + 2 y + y^3 + y^6 /. y -> a^2,
a^6 + a + 2, a, Modulus -> 3][[2]]

(* Out[81]= 0 *)


Also note that the "it is well known..." part should be using powers of a^2 rather than a. To get the result from that polynomial, can reduce by the defining polynomial, as below.

asqrPoly =
PolynomialReduce[(x - (a^2))*(x - (a^2)^3)*(x - (a^2)^9)*(x - \
(a^2)^27)*(x - (a^2)^81)*(x - (a^2)^243), a^6 + a + 2, a,
Modulus -> 3][[2]]

(* Out[90]= 1 + 2 x + x^3 + x^6 *)


Recheck...

PolynomialReduce[asqrPoly /. x -> a^2, a^6 + a + 2, a,
Modulus -> 3][[2]]

(* Out[91]= 0 *)