1
$\begingroup$

My code below returns 4032. The OEIS sequence A002820 says there are 5824 such matrices. Is there something wrong with my code. I am assuming that the eigenvalues of a matrix are precisely the roots of the characteristic polynomial. If the characteristic polynomial of a matrix is irreducible over the underlying field then the matrix has no eigenvalues. Right?

Count[Map[
  IrreduciblePolynomialQ[CharacteristicPolynomial[#, x], 
    Modulus -> 2] &, Tuples[Tuples[{0, 1}, 4], 4]], True]
$\endgroup$
  • 1
    $\begingroup$ The characteristic polynomial could have irreducible quadratic factors. $\endgroup$ – Daniel Lichtblau Dec 14 '17 at 19:29
2
$\begingroup$
noLinearFax[mat_] := 
 Module[{x}, 
  With[{fax = 
     FactorList[CharacteristicPolynomial[mat, x], Modulus -> 2]},
   (Length[fax] == 2 && fax[[2, 2]] != 4) || (Length[fax] == 3 && 
      Rest[fax][[All, 2]] === {1, 1} && 
      Map[Exponent[#, x] &, Rest[fax][[All, 1]]] == {2, 2})]]

AbsoluteTiming[
 Count[Map[noLinearFax, Tuples[Tuples[{0, 1}, 4], 4]], True]]

(* Out[506]= {12.913031, 5824} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.