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.

A365926 Number of distinct characteristic polynomials for n X n matrices with entries in {0, 1, ..., n-1}.

Original entry on oeis.org

1, 1, 6, 513, 2875405
Offset: 0

Views

Author

Robert P. P. McKone, Sep 23 2023

Keywords

Crossrefs

Programs

  • 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}]
  • 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

Extensions

a(4) from Robin Visser, May 04 2025