cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A091472 Number of n X n matrices with entries {0,1} that are diagonalizable over the complex numbers.

Original entry on oeis.org

2, 12, 320, 43892, 24266888
Offset: 1

Views

Author

Eric W. Weisstein, Jan 12 2004

Keywords

Comments

A matrix M is diagonalizable over a field F if there is an invertible matrix S with entries from F such that S^(-1) M S is diagonal.
An n X n matrix M is diagonalizable if and only if it has n linearly independent eigenvectors.

Examples

			a(2) = 12: all except 00/10, 01/00, 11/01, 10/11.
		

References

  • R. A. Horn and C. R. Johnson, Matrix Analysis, Cambridge, 1988, Section 1.3.

Crossrefs

Programs

  • Mathematica
    Needs["Utilities`FilterOptions`"] Options[DiagonalizableQ]={ Field->Complexes, ZeroTest->(RootReduce[ # ]===0&) };
    Matrices[n_, l_List:{0, 1}] := Partition[ #, n]&/@Flatten[Outer[List, Sequence@@Table[l, {n^2}]], n^2-1]
    DiagonalizableQ[m_List?MatrixQ, opts___] := Module[ { field=Field/.{opts}/.Options[DiagonalizableQ], eigenopts=FilterOptions[Eigenvectors, opts] }, Switch[field, Complexes, ComplexDiagonalizableQ[m, eigenopts], Reals, RealDiagonalizableQ[m, eigenopts] ] ]
    Table[Count[Matrices[n], _?DiagonalizableQ], {n, 4}]
    (* Second program: *)
    a[n_] := Module[{M, iter, cnt=0}, M = Table[a[i, j], {i, 1, n}, {j, 1, n}]; iter = Thread[{Flatten[M], 0, 1}]; Do[If[DiagonalizableMatrixQ[M], cnt++], Evaluate[Sequence @@ iter]]; cnt];
    Do[Print[n, " ", a[n]], {n, 1, 4}] (* Jean-François Alcover, Dec 09 2018 *)
  • Sage
    import itertools
    def a(n):
        ans, W = 0, itertools.product([0, 1], repeat=n*n)
        for w in W:
            if Matrix(QQbar, n, n, w).is_diagonalizable(): ans += 1
        return ans  # Robin Visser, Sep 24 2023

Extensions

a(5) from Robin Visser, Sep 24 2023