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.

Showing 1-10 of 14 results. Next

A272658 Number of distinct characteristic polynomials of n X n matrices with elements {-1, 0, +1}.

Original entry on oeis.org

1, 3, 16, 209, 8739, 1839102
Offset: 0

Views

Author

N. J. A. Sloane, May 15 2016

Keywords

References

  • Robert M. Corless, Bohemian Eigenvalues, Talk Presented at Computational Discovery in Mathematics (ACMES 2), University of Western Ontario, May 12 2016. (Talk based on joint work with Steven E. Thornton, Sonia Gupta, Jonathan Brino-Tarasoff, Venkat Balasubramanian.)

Crossrefs

Six classes of matrices mentioned in Rob Corless's talk: this sequence, A272659, A272660, A272661, A272662, A272663.
Other properties of this class of matrices: A271570, A271587, A271588. - Steven E. Thornton, Jul 13 2016

Programs

  • Mathematica
    a[n_] := a[n] = Module[{m, cPolys}, m = Tuples[Tuples[{-1, 0, 1}, n], n]; cPolys = CharacteristicPolynomial[#, x] & /@ m; Length[DeleteDuplicates[cPolys]]]; Table[a[i], {i, 1, 3}] (* Robert P. P. McKone, Sep 16 2023 *)
  • Python
    from itertools import product
    from sympy import Matrix
    def A272658(n): return len({tuple(Matrix(n,n,p).charpoly().as_list()) for p in product((-1,0,1),repeat=n**2)}) if n else 1 # Chai Wah Wu, Sep 30 2023

Formula

a(n) <= 3^(n^2). - Robert P. P. McKone, Sep 16 2023

Extensions

a(4) found by Daniel Lichtblau, May 13 2016
a(5) found by Daniel Lichtblau and Steven E. Thornton, May 19 2016
a(0)=1 prepended by Alois P. Heinz, Sep 28 2023

A272661 Number of distinct characteristic polynomials of n X n matrices with elements {0, 1}.

Original entry on oeis.org

1, 2, 6, 32, 333, 8927, 758878
Offset: 0

Views

Author

N. J. A. Sloane, May 15 2016

Keywords

References

  • Robert M. Corless, Bohemian Eigenvalues, Talk Presented at Computational Discovery in Mathematics (ACMES 2), University of Western Ontario, May 12 2016. (Talk based on joint work with Steven E. Thornton, Sonia Gupta, Jonathan Brino-Tarasoff, Venkat Balasubramanian.)

Crossrefs

Six classes of matrices mentioned in Rob Corless's talk: A272658, A272659, A272660, A272661, A272662, A272663.

Programs

  • MATLAB
    function count = A272661(N)
      C = zeros(0,N);
      count = 0;
      V = zeros(1,N);
      L = -floor(N/2) + [0:N-1];
      for x = 0:2^(N^2)-1;
        r = dec2bin(x+2^(N^2))-'0';
        A = reshape(r(2:end),N,N);
        rowcounts = sum(A,2);
        colcounts = sum(A,1);
        if ~issorted(rowcounts)|| rowcounts(N) < max(colcounts)
          continue
        end
        for i = 1:N
            V(i) = round(det(A - L(i)*eye(N)));
        end
        if ~ismember(V, C, 'rows')
          count = count+1;
          C(count,:) = V;
        end
      end
    end  % Robert Israel, Aug 18 2016
    
  • Python
    from itertools import product
    from sympy import Matrix
    def A272661(n): return len({tuple(Matrix(n,n,p).charpoly().as_list()) for p in product((0,1),repeat=n**2)}) if n else 1 # Chai Wah Wu, Sep 30 2023

Extensions

a(5) from Robert Israel, Aug 18 2016
a(6) from Steven E. Thornton, Mar 09 2019
a(0)=1 prepended by Alois P. Heinz, Sep 28 2023

A272662 Number of distinct characteristic polynomials of n X n matrices with elements {-1, +1}.

Original entry on oeis.org

1, 2, 6, 28, 203, 3150, 131641
Offset: 0

Views

Author

N. J. A. Sloane, May 15 2016

Keywords

References

  • Robert M. Corless, Bohemian Eigenvalues, Talk Presented at Computational Discovery in Mathematics (ACMES 2), University of Western Ontario, May 12 2016. (Talk based on joint work with Steven E. Thornton, Sonia Gupta, Jonathan Brino-Tarasoff, Venkat Balasubramanian.)

Crossrefs

Six classes of matrices mentioned in Rob Corless's talk: A272658, A272659, A272660, A272661, A272662, A272663.

Programs

  • Python
    from itertools import product
    from sympy import Matrix
    def A272662(n): return len({tuple(Matrix(n,n,p).charpoly().as_list()) for p in product((-1,1),repeat=n**2)}) if n else 1 # Chai Wah Wu, Sep 30 2023

Extensions

a(5) and a(6) from Steven E. Thornton, Mar 09 2019
a(0)=1 prepended by Alois P. Heinz, Sep 28 2023

A272660 Number of distinct characteristic polynomials of n X n matrices with elements {t, 1, 2} where t is an indeterminate.

Original entry on oeis.org

1, 3, 36, 1782, 760678
Offset: 0

Views

Author

N. J. A. Sloane, May 15 2016

Keywords

Examples

			From _Robin Visser_, May 01 2025: (Start)
For n = 1, the a(1) = 3 possible characteristic polynomials are x - 2, x - 1, and x - t.
For n = 2, the a(2) = 36 possible characteristic polynomials are x^2 - 2x - 1, x^2 - 2x, x^2 + (-t-2)x, x^2 + (-t-2)x - t^2+2t, x^2 + (-t-1)x, x^2 + (-t-1)x - t^2+t, x^2 - 4x, x^2 - 4x + 2, x^2 - 4x + 3, x^2 - 3x - 2, x^2 - 3x, x^2 - 3x + 1, x^2 - 2tx + t^2-4, x^2 - 2tx + t^2-2, x^2 - 2tx + t^2-1, x^2 + (-t-2)x + t, x^2 - 4x - t+4, x^2 - 4x - t^2+4, x^2 - 2x - 3, x^2 - 2tx, x^2 - 2tx + t^2-t, x^2 - 2tx + t^2-2t, x^2 - 4x - 2t+4, x^2 - 3x - t^2+2, x^2 - 3x - t+2, x^2 - 3x - 2t+2, x^2 - 2x - t^2+1, x^2 - 2x - t+1, x^2 - 2x - 2t+1, x^2 + (-t-2)x + 2t-4, x^2 + (-t-2)x + 2t-2, x^2 + (-t-2)x + 2t-1, x^2 + (-t-1)x + t-4, x^2 + (-t-1)x + t-2, x^2 + (-t-1)x + t-1, and x^2 + (-t-1)x - t. (End)
		

References

  • Robert M. Corless, Bohemian Eigenvalues, Talk Presented at Computational Discovery in Mathematics (ACMES 2), University of Western Ontario, May 12 2016. (Talk based on joint work with Steven E. Thornton, Sonia Gupta, Jonathan Brino-Tarasoff, Venkat Balasubramanian.)

Crossrefs

Six classes of matrices mentioned in Rob Corless's talk: A272658, A272659, A272660, A272661, A272662, A272663.

Programs

  • Sage
    import itertools
    def a(n):
        ans, t = set(), SR('t')
        W = itertools.product([t, 1, 2], repeat=n*n)
        for w in W: ans.add(Matrix(SR, n, n, w).charpoly())
        return len(ans)  # Robin Visser, May 01 2025

Extensions

a(0)=1 prepended by Alois P. Heinz, Sep 28 2023
a(4) from Robin Visser, May 01 2025

A272663 Number of distinct characteristic polynomials of n X n matrices with elements {t, 1}, where t is an indeterminate.

Original entry on oeis.org

1, 2, 9, 68, 1161, 65348
Offset: 0

Views

Author

N. J. A. Sloane, May 15 2016

Keywords

Examples

			From _Robin Visser_, May 01 2025: (Start)
For n = 1, the a(1) = 2 possible characteristic polynomials are x - 1 and x - t.
For n = 2, the a(2) = 9 possible characteristic polynomials are x^2 - 2*x, x^2 - 2*t*x, x^2 - 2*t*x + t^2 - t, x^2 + (-t - 1)*x, x^2 + (-t - 1)*x - t^2 + t, x^2 - 2*x - t^2 + 1, x^2 - 2*t*x + t^2 - 1, x^2 - 2*x - t + 1, and x^2 + (-t - 1)*x + t - 1. (End)
		

Crossrefs

Six classes of matrices mentioned in Rob Corless's talk: A272658, A272659, A272660, A272661, A272662, A272663.

Programs

  • Sage
    import itertools
    def a(n):
        ans, t = set(), SR('t')
        W = itertools.product([t, 1], repeat=n*n)
        for w in W: ans.add(Matrix(SR, n, n, w).charpoly())
        return len(ans)  # Robin Visser, May 01 2025

Extensions

a(0)=1 prepended by Alois P. Heinz, Sep 28 2023
a(5) from Robin Visser, May 04 2025

A306783 Number of distinct minimal polynomials of n X n matrices with elements {0, 1, 2}.

Original entry on oeis.org

3, 25, 532, 58693
Offset: 1

Views

Author

Steven E. Thornton, Mar 09 2019

Keywords

Crossrefs

Number of characteristic polynomials is in A272659.

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

A366448 Number of distinct characteristic polynomials for 2 X 2 matrices with entries from {0, 1, ..., n}.

Original entry on oeis.org

1, 6, 22, 58, 116, 221, 356, 573, 824, 1163, 1565, 2143, 2697, 3527, 4385, 5388, 6455, 7992, 9342, 11262, 12953, 15034, 17301, 20246, 22595, 25823, 29054, 32679, 36228, 41112, 44964, 50600, 55288, 60770, 66543, 72927, 78173, 86577, 93925, 101775, 108798
Offset: 0

Views

Author

Robert P. P. McKone, Oct 10 2023

Keywords

Examples

			For n = 1 the a(1) = 6 characteristic polynomials are {x^2, -4 + x^2, -2 + x^2, -1 + x^2, -4*x + x^2, 2-4*x + x^2}.
		

Crossrefs

Cf. A366551 (3 X 3 matrices), A367978 (4 X 4 matrices).
Cf. A058331 (determinants), A005408 (traces).

Programs

  • Mathematica
    mat[n_Integer?Positive]:=mat[n]=Array[m,{n,n}]; flatMat[n_Integer?Positive]:=flatMat[n]=Flatten[mat[n]]; charPolyMat[n_Integer?Positive]:=charPolyMat[n]=FullSimplify[CoefficientList[Expand[CharacteristicPolynomial[mat[n],x]],x]]; 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}],3]]]; Table[a[2,n],{n,0,41}]
  • PARI
    a(n) = my(list=List()); for (i=0, n, for (j=0, n, for(k=0, n, for(m=0, n, my(p=charpoly([i,j;k,m])); listput(list, p))))); #Set(list); \\ Michel Marcus, Oct 11 2023
    
  • Python
    def A366448(n): return len({(a+d,a*d-b*c) for a in range(n+1) for b in range(n+1) for c in range(b+1) for d in range(a+1)}) # Chai Wah Wu, Oct 12 2023

Formula

a(n) <= A058331(n) * A005408(n) = 4*n^3 + 2*n^2 + 2*n + 1.
A058331(n) = 2*n^2 + 1 <= a(n). - Charles R Greathouse IV, May 08 2025

A366551 Number of distinct characteristic polynomials for 3 X 3 matrices with entries from {0, 1, ..., n}.

Original entry on oeis.org

1, 32, 513, 4407, 21393, 86620, 242057, 673623, 1467642, 3107487, 5836467, 11108595, 18102935, 31327359, 48505904, 74802671, 110297111, 166721570, 230270840
Offset: 0

Views

Author

Robert P. P. McKone, Oct 13 2023

Keywords

Crossrefs

Cf. A366448 (2 X 2 matrices), A367978 (4 X 4 matrices).
Cf. A366158 (determinants), A227776 (2nd order coefficients), A016777 (traces).
Cf. A272659.

Programs

  • Mathematica
    mat[n_Integer?Positive] := mat[n] = Array[m, {n, n}]; flatMat[n_Integer?Positive] := flatMat[n] = Flatten[mat[n]]; charPolyMat[n_Integer?Positive] := charPolyMat[n] = FullSimplify[CoefficientList[Expand[CharacteristicPolynomial[mat[n], x]], x]]; 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]]]; Table[a[3, n], {n, 0, 7}]
  • Sage
    import itertools
    def a(n):
        ans, W = set(), itertools.product(range(n+1), repeat=9)
        for w in W: ans.add(Matrix(ZZ, 3, 3, w).charpoly())
        return len(ans)  # Robin Visser, May 08 2025

Formula

a(n) <= A366158(n) * A227776(n) * A016777(n).

Extensions

a(12)-a(18) from Robin Visser, May 08 2025

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

Original entry on oeis.org

3, 25, 1027, 193244
Offset: 1

Views

Author

Steven E. Thornton, Mar 10 2019

Keywords

Crossrefs

Number of characteristic polynomials is in A272659.
Number of minimal polynomials is in A306783.

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
Showing 1-10 of 14 results. Next