# The Caverns of Primitive Polynomial GF[2]

With primitive polynomials, it's not too hard to get all the polynomials of a particular power. For example, columns in the following represent the 18, 16, 48, and 60 primitive polynomials of GF[2^7], GF[2^8], GF[2^9], and GF[2^10]:

You can also enter at the left, visit every white space, and exit at the right. It's a continuous connected cavern.

But here, I got lost in the caverns of GF[2^12]. I wasn't able to visit all the white spaces, and likely got eaten by a grue. Is there an optimal way to shuffle this set of primitive polynomial coefficients?

Here's more bad, dangerous caverns for all the primitive polynomials in caverns for powers 5 to 14.

Can the orderings of these primitive polynomials be made as safe as the solution for GF[2^7]-GF[2^10] at the top? Here are best found so for for GF[2^11] and GF[2^12]

• Is the rotational symmetry in the three good patterns an accident? – Ethan Bolker Feb 10 '17 at 18:14
• Symmetry helps to simplify the problem. – Ed Pegg Feb 10 '17 at 22:33
• @EthanBolker: My guess would be that the rotational symmetry comes from the fact that the reciprocal of a primitive polynomial is always also primitive. The ordering of the columns may be such that the reciprocals appear at opposite ends. – Jyrki Lahtonen Feb 10 '17 at 22:48
• @EdPegg How do you computationally generate all the primitive polynomials for a given power ? Your caverns are very beautiful. – Donald Splutterwit Mar 31 '17 at 0:58
• Module[{prime = 2, pow = 12, div}, div = Reverse[Divisors[prime^pow - 1]]; Select[Total[ MapIndexed[ x^(#2[[1]] - 1) #1 &, #]] & /@ (Reverse[Flatten[{1, #}]] & /@ Tuples[Range[0, prime - 1], {pow}]), IrreduciblePolynomialQ[#, Modulus -> prime] && Length[ Union[Table[ PolynomialMod[x^div[[k]], #, Modulus -> prime], {k, 1, Length[div]}]]] == Length[div] &]] ----- This code will generate the primitive polynomials for GF[2^12]. – Ed Pegg Mar 31 '17 at 14:54