login
A365926
Number of distinct characteristic polynomials for n X n matrices with entries in {0, 1, ..., n-1}.
3
OFFSET
0,3
COMMENTS
a(4) >= 308696.
MATHEMATICA
a[n_] := Module[{polynomials = {}, polynomial}, Monitor[Do[polynomial = CharacteristicPolynomial[ArrayReshape[IntegerDigits[i, n, n^2], {n, n}], x]; If[Not[MemberQ[polynomials, polynomial]], AppendTo[polynomials, polynomial]]; , {i, 0, n^(n^2) - 1}], {n, {i, n^(n^2) - 1}, ProgressIndicator[i, {0, n^(n^2) - 1}]}]; Length[polynomials]]; Table[a[n], {n, 1, 3}]
PROG
(Python)
from itertools import product
from sympy import Matrix
def A365926(n): return len({tuple(Matrix(n, n, p).charpoly().as_list()) for p in product(range(n), repeat=n**2)}) if n else 1 # Chai Wah Wu, Sep 30 2023
CROSSREFS
KEYWORD
nonn,hard,more,bref
AUTHOR
Robert P. P. McKone, Sep 23 2023
STATUS
approved