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.
%I A367978 #12 May 05 2025 07:51:32 %S A367978 1,333,58335,2875405,47125558 %N A367978 Number of distinct characteristic polynomials for 4 X 4 matrices with entries from {0, 1, ..., n}. %t A367978 mat[n_Integer?Positive] := mat[n] = Array[m, {n, n}]; %t A367978 flatMat[n_Integer?Positive] := flatMat[n] = Flatten[mat[n]]; %t A367978 charPolyMat[n_Integer?Positive] := charPolyMat[n] = FullSimplify[CoefficientList[Expand[CharacteristicPolynomial[mat[n], x]], x]]; %t A367978 a[d_Integer?Positive, 0] = 1; a[d_Integer?Positive, n_Integer?Positive] := a[d, n] = Length[DeleteDuplicates[Flatten[Table[Evaluate[charPolyMat[d]], ##] & @@ Table[{flatMat[d][[i]], 0, n}, {i, 1, d^2}], d^2 - 1]]]; %t A367978 Table[a[4, n], {n, 0, 2}] %o A367978 (Sage) %o A367978 import itertools %o A367978 def a(n): %o A367978 ans, W = set(), itertools.product(range(n+1), repeat=16) %o A367978 for w in W: ans.add(Matrix(ZZ, 4, 4, w).charpoly()) %o A367978 return len(ans) # _Robin Visser_, May 04 2025 %Y A367978 Cf. A366448 (2 X 2 matrices), A366551 (3 X 3 matrices). %Y A367978 Cf. A272659. %K A367978 nonn,more,hard %O A367978 0,2 %A A367978 _Robert P. P. McKone_, Dec 07 2023 %E A367978 a(4) from _Robin Visser_, May 04 2025