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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

2, 12, 464, 50224, 25095232
Offset: 1

Views

Author

Eric W. Weisstein, Jan 12 2004

Keywords

Comments

See A091472 for definition of diagonalizable and for Mathematica definitions.

Crossrefs

Programs

  • Mathematica
    Table[Count[Matrices[n, {-1, 1}], _?DiagonalizableQ], {n, 4}]
  • Sage
    import itertools
    def a(n):
        ans, W = 0, itertools.product([-1, 1], repeat=n*n)
        for w in W:
            if Matrix(QQbar, n, n, w).is_diagonalizable(): ans += 1
        return ans  # Robin Visser, Sep 27 2023

Extensions

a(5) from Robin Visser, Sep 27 2023

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

A338413 Number of 2 X 2 matrices with integer entries in [-n,n] that are diagonalizable over the complex numbers.

Original entry on oeis.org

65, 569, 2281, 6313, 14265, 28033, 49921, 82545, 128945, 192809, 277849, 388185, 528617, 704049, 919857, 1181393, 1495569, 1868249, 2306921, 2818441, 3410809, 4091937, 4870273, 5754449, 6753233, 7877641, 9136441, 10540633, 12101001, 13828465, 15734545, 17830353, 20129713, 22644553, 25387929
Offset: 1

Views

Author

Matthew Niemiro, Nov 07 2020

Keywords

Comments

A diagonalizable matrix A is one which can be expressed as XDY, where D is a diagonal matrix and X = Y^-1 are square matrices. By 'diagonalizable over C,' it is meant that the matrix D has complex entries.
The nondiagonalizable 2 x 2 matrices are the nondiagonal ones whose characteristic polynomial has discriminant 0. - Robert Israel, Nov 12 2020

Crossrefs

a(1) is given by A091470(2).

Programs

  • Maple
    N:= 30: # for a(1)..a(N)
    V:= Vector(N):
    for t from 1 to N do
      for d in select(`<=`,numtheory:-divisors(t^2),N) do
        for n from max(d, t^2/d) to N do
          V[n]:= V[n] + (8*(n-t)+4)
    od od od:
    for n from 1 to N do V[n]:= (2*n+1)^4 - (V[n] + 4*n*(2*n+1)) od:
    convert(V,list); # Robert Israel, Nov 12 2020
  • Mathematica
    a[n_] := Length[Select[Tuples[Tuples[Range[-n, n], 2], 2], DiagonalizableMatrixQ]];

Extensions

More terms from Robert Israel, Nov 12 2020
Showing 1-3 of 3 results.