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.

A203994 Symmetric matrix based on f(i,j) = (i+j)*min{i,j}, by antidiagonals.

Original entry on oeis.org

1, 0, 0, -1, 1, -1, -2, 0, 0, -2, -3, -1, 1, -1, -3, -4, -2, 0, 0, -2, -4, -5, -3, -1, 1, -1, -3, -5, -6, -4, -2, 0, 0, -2, -4, -6, -7, -5, -3, -1, 1, -1, -3, -5, -7, -8, -6, -4, -2, 0, 0, -2, -4, -6, -8, -9, -7, -5, -3, -1, 1, -1, -3, -5, -7, -9
Offset: 1

Views

Author

Clark Kimberling, Jan 09 2012

Keywords

Comments

A203994 represents the matrix M given by f(i,j) = min(i-j+1,j-i+1) for i >= 1 and j >= 1. See A203995 for characteristic polynomials of principal submatrices of M, with interlacing zeros.

Examples

			Northwest corner:
   1    0   -1   -2   -3
   0    1    0   -1   -2
  -1    0    1    0   -1
   2   -1    0    1    0
		

Crossrefs

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> Minimum(2*k-n, n-2*k+2) ))); # G. C. Greubel, Jul 23 2019
  • Magma
    [Min(2*k-n, n-2*k+2): k in [1..n], n in [1..15]]; // G. C. Greubel, Jul 23 2019
    
  • Mathematica
    (* First program *)
    f[i_, j_] := Min[i - j + 1, j - i + 1];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[6]] (* 6 X 6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
    {n, 1, 12}, {i, 1, n}]]  (* A203994 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]    (* A203995 *)
    TableForm[Table[c[n], {n, 1, 10}]]
    (* Second program *)
    Table[Min[2*k-n, n-2*k+2], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Jul 23 2019 *)
  • PARI
    for(n=1,15, for(k=1,n, print1(min(2*k-n, n-2*k+2), ", "))) \\ G. C. Greubel, Jul 23 2019
    
  • Sage
    [[min(2*k-n, n-2*k+2) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Jul 23 2019