I am testing Prime polynomials in $GF(2)$ and have noticed a pattern that I hope will help.
There's a calculator here if you want to familiarise yourself with polynomials over $GF(2)$.
I am testing for primitivity and am therefore, given a polynomial of degree $d$, testing to see if it divides any polynomial $2^n + 1$ for $n$ from $1$ to $2^p-1$.
For example, given the prime polynomial $x^6 + x^3 + 1$ I can see that $(x^9 + 1)/(x^6 + x^3 + 1) = (x^3 + 1)$ so it is therefore not primitive because $9$ is less than $2^6 - 1 = 63$.
There seems to be a significant pattern emerging. Most of the dividends are similar for any specific degree of polynomial. For example, out of the $99$ degree $10$ prime polynomials $60$ are primitive and $39$ are divisors of a polynomial of the above form. But here's the strange thing, the dividends consist of just $(2^{33} + 1)$ $(2^{93} + 1)$ and $(2^{341} + 1)$. Just those threeare dividends to $39$ degree $10$ polynomials between them - and their degrees are all factors, or multiples of the factors of $1023 = 2^{10} - 1$ which are $3,11,31,33,93,341$. Coincidence? Degree = 10! Factors of $1023$ has close relationship to powers of the dividends?
Here's the pattern for each of the degrees $d$ I have tested so far:
$$\begin{array}{|r|r|l|l|} \hline \text{$d$} & \text{$2^d - 1$} & \text{Factors of $2^d - 1$} & \text{Degrees of $x^n + 1$ as a dividend}\\ \hline 4 & 15 & 3, 5 & 5 \\ \hline 5 & 31 & - & - \\ \hline 6 & 63 & 3, 3, 7 & 9, 21 \\ \hline 7 & 127 & - & - \\ \hline 8 & 255 & 3, 5, 7 & 51, 85 \\ \hline 9 & 511 & 7, 73 & 73 \\ \hline 10 & 1023 & 3, 11, 31 & 33, 93, 341 \\ \hline 11 & 2047 & 23, 89 & 23, 89 \\ \hline 12 & 4095 & 3, 3, 5, 7, 13 & 45, 195, 315, 455, 585, 1365, 1638 \\ \hline 13 & 8191 & - & \\ \hline 14 & 16383 & 3, 43, 127 & 129, 381, 5461 \\ \hline \end{array}$$
So - any ideas on how I could come up with a list of all possible dividends so I don't have to trawl through $2^d - 1$ of them - which gets seriously tiring as the degree rises.
Notes:
- I stop when I find the first dividend that can be divided by the polynomial - so there may be more tham I list.
- I use a
ForkJoinPool
to do my factoring so it is possible that occasionally I am not finding the lowest degree dividend but I think that is likely to be rare.
Added
I think I've found a further pattern I would like some feedback on - not sure if this should be another question or not. I would welcome feedback.
I decided to print out the totient
of each dividend I was using to test for primitivity and see if the count of how many times this dividend was used to distinguish primality from primitivity was related.
The relationship is unmistakeable. It looks very much like the number of polynomials each dividend is divided by is equal to the totient of the degree of the dividend divided by the degree of the polynomial.
For example - with our degree 10 polynomials, for each dividend there are the following number of polynomials that are factors - (11, 1), (33, 2), (93, 6), (341, 30). i.e there is one irreducible polynomial that divides $x^{11} + 1$, two that divide $x^{33} + 1$ etc. Interestingly $totient(11) = 10$ and $10/degree = 1$ all the way up to $totient(341)=300$ and $300/10=30$. Rest assured this pattern works for all degrees up to 12 at least.
Further - for degree 12 polynomials - there are $48$ polynomials that divide $2^{1365} + 1$ and, amazingly, totient
(1365) = 576 = 12 * 48.
Is this another pattern I can rely on? Is it based on theory?