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.

This page as a plain text file.
%I A091472 #18 Feb 16 2025 08:32:52
%S A091472 2,12,320,43892,24266888
%N A091472 Number of n X n matrices with entries {0,1} that are diagonalizable over the complex numbers.
%C A091472 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.
%C A091472 An n X n matrix M is diagonalizable if and only if it has n linearly independent eigenvectors.
%D A091472 R. A. Horn and C. R. Johnson, Matrix Analysis, Cambridge, 1988, Section 1.3.
%H A091472 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DiagonalizableMatrix.html">Diagonalizable Matrix</a>
%H A091472 <a href="/index/Mat#binmat">Index entries for sequences related to binary matrices</a>
%e A091472 a(2) = 12: all except 00/10, 01/00, 11/01, 10/11.
%t A091472 Needs["Utilities`FilterOptions`"] Options[DiagonalizableQ]={ Field->Complexes, ZeroTest->(RootReduce[ # ]===0&) };
%t A091472 Matrices[n_, l_List:{0, 1}] := Partition[ #, n]&/@Flatten[Outer[List, Sequence@@Table[l, {n^2}]], n^2-1]
%t A091472 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] ] ]
%t A091472 Table[Count[Matrices[n], _?DiagonalizableQ], {n, 4}]
%t A091472 (* Second program: *)
%t A091472 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];
%t A091472 Do[Print[n, " ", a[n]], {n, 1, 4}] (* _Jean-François Alcover_, Dec 09 2018 *)
%o A091472 (Sage)
%o A091472 import itertools
%o A091472 def a(n):
%o A091472     ans, W = 0, itertools.product([0, 1], repeat=n*n)
%o A091472     for w in W:
%o A091472         if Matrix(QQbar, n, n, w).is_diagonalizable(): ans += 1
%o A091472     return ans  # _Robin Visser_, Sep 24 2023
%Y A091472 Cf. A091470, A091471.
%K A091472 nonn,more
%O A091472 1,1
%A A091472 _Eric W. Weisstein_, Jan 12 2004
%E A091472 a(5) from _Robin Visser_, Sep 24 2023