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.

A306792 Number of distinct eigenvalues of n X n matrices with elements {0, 1, 2}.

This page as a plain text file.
%I A306792 #12 Mar 27 2021 03:55:26
%S A306792 3,25,1027,193244
%N A306792 Number of distinct eigenvalues of n X n matrices with elements {0, 1, 2}.
%H A306792 S. E. Thornton, <a href="http://www.bohemianmatrices.com/cpdb/unstructured/unstructured_0_1_2">Properties of the Bohemian family of n x n matrices with population {0, 1, 2}</a>, Characteristic Polynomial Database.
%o A306792 (Python)
%o A306792 from itertools import product
%o A306792 from sympy.matrices import Matrix
%o A306792 def a(n):
%o A306792   eigset = set()
%o A306792   for e in product([0, 1, 2], repeat=n*n):
%o A306792     if n > 1 and e[1] > e[n]: continue
%o A306792     M = Matrix([list(e[n*r:n*(r+1)]) for r in range(n)])
%o A306792     eigset |= set(eig for eig in M.eigenvals().keys())
%o A306792   return len(eigset)
%o A306792 print([a(n) for n in range(1, 3)]) # _Michael S. Branicky_, Mar 25 2021
%Y A306792 Number of characteristic polynomials is in A272659.
%Y A306792 Number of minimal polynomials is in A306783.
%K A306792 nonn,more,hard
%O A306792 1,1
%A A306792 _Steven E. Thornton_, Mar 10 2019