A306792 Number of distinct eigenvalues of n X n matrices with elements {0, 1, 2}.
3, 25, 1027, 193244
Offset: 1
Links
- S. E. Thornton, Properties of the Bohemian family of n x n matrices with population {0, 1, 2}, Characteristic Polynomial Database.
Crossrefs
Programs
-
Python
from itertools import product from sympy.matrices import Matrix def a(n): eigset = set() for e in product([0, 1, 2], repeat=n*n): if n > 1 and e[1] > e[n]: continue M = Matrix([list(e[n*r:n*(r+1)]) for r in range(n)]) eigset |= set(eig for eig in M.eigenvals().keys()) return len(eigset) print([a(n) for n in range(1, 3)]) # Michael S. Branicky, Mar 25 2021