
This Maple code can be used to check the primitiveness of some variations
of the specified polynomials. It has been tested on Maple V Release 3.

Modified from example on http://www.maplesoft.com/apps/html/trinom.html


 First define some things:

readlib(ifactors):
fastifactors := proc(n) local f;
f := factor(x^n-1);
f := subs(x=2,[op(f)]);
f := map(ifactor,f);
ifactors(convert(f,`*`));
end:

 Then run:

for k from 2 to 32 do
n := fastifactors(k);
trinomials := NULL;
r:=round(k/2);
for i from 1 to k do
candidate := x^k+x^i+x^r+x^(r+1)+1;
if not Irreduc(candidate) mod 2 then next fi;
isPrimitive := true;
for j in n[2] while isPrimitive do
if Powmod(x,(2^k-1)/j[1],candidate,x) mod 2 = 1 then
isPrimitive := false
fi;
od;
if isPrimitive then
trinomials := trinomials, candidate, `and its inverse`;
fi;
od;
if trinomials <> NULL then print(`degree `.k, trinomials) fi;
od:
