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-2 of 2 results.

A374139 a(n) is the determinant of the symmetric Toeplitz matrix of order n whose element (i,j) equals abs(i-j) or 1 if i = j.

Original entry on oeis.org

1, 1, 0, -1, 1, 3, 0, -3, 1, 5, 0, -5, 1, 7, 0, -7, 1, 9, 0, -9, 1, 11, 0, -11, 1, 13, 0, -13, 1, 15, 0, -15, 1, 17, 0, -17, 1, 19, 0, -19, 1, 21, 0, -21, 1, 23, 0, -23, 1, 25, 0, -25, 1, 27, 0, -27, 1, 29, 0, -29, 1, 31, 0, -31, 1, 33, 0, -33, 1, 35, 0, -35, 1, 37, 0, -37
Offset: 0

Views

Author

Stefano Spezia, Jun 28 2024

Keywords

Comments

A minor variant of A166445. - R. J. Mathar, Jul 01 2024

Examples

			a(4) = 1:
  [1, 1, 2, 3]
  [1, 1, 1, 2]
  [2, 1, 1, 1]
  [3, 2, 1, 1]
		

Crossrefs

Cf. A056594, A071078, A085750, A374140 (permanent).

Programs

  • Mathematica
    a[n_]:=Det[Table[If[i == j, 1, Abs[i - j]], {i, n}, {j, n}]]; Join[{1}, Array[a, 75]]
  • PARI
    a(n) = matdet(matrix(n, n, i, j, if (i==j, 1, abs(i-j)))); \\ Michel Marcus, Jun 29 2024
    
  • Python
    from sympy import Matrix
    def A374139(n): return Matrix(n,n,[abs(j-k) if j!=k else 1 for j in range(n) for k in range(n)]).det() # Chai Wah Wu, Jul 01 2024

Formula

G.f.: (1 + x^2 - x^3 + x^4)/((1 - x)*(1 + x^2)^2).
a(n) = a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-5) for n > 4.
a(n) = (1 + A056594(n) + n*A056594(n+1))/2.
E.g.f.: (exp(x) + (1 + x)*cos(x))/2.
For a proof of the generating function and the recursion formula, see MathOverflow link. - Sela Fried, Jul 09 2024

A203993 Array: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of {|i-j}, (A049581).

Original entry on oeis.org

0, -1, -1, 0, 1, 4, 6, 0, -1, -12, -32, -20, 0, 1, 32, 120, 140, 50, 0, -1, -80, -384, -648, -448, -105, 0, 1, 192, 1120, 2464, 2520, 1176, 196, 0, -1, -448, -3072, -8320, -11264, -7920, -2688, -336, 0, 1, 1024, 8064, 25920, 43680
Offset: 1

Views

Author

Clark Kimberling, Jan 09 2012

Keywords

Comments

Let p(n)=p(n,x) be the characteristic polynomial of the n-th principal submatrix. The zeros of p(n) are real, and they interlace the zeros of p(n+1). See A202605 for a guide to related sequences.
Also the coefficients of the detour and distance polynomials of the n-path graph P_n. - Eric W. Weisstein, Apr 07 2017
p(n,x) = (-x)^n*(x*(1 + T(n, 1+1/x)) - n*S(n-1, 2*(1+1/x)))/(2*x), with the Chebyshev polynomials S (A049310) and T (A053120). This is the rewritten formula given below in the Mathematica program by Weisstein. - Wolfdieter Lang, Feb 02 2018

Examples

			The array T (a table if row n=0 is by convention put to 0) begins:
n\k     0      1      2       3       4       5      6      7     8    9  10 ...
(0:     0)
1:      0     -1
2:     -1      0      1
3:      4      6      0      -1
4:    -12    -32    -20       0       1
5:     32    120    140      50       0      -1
6:    -80   -384   -648    -448    -105       0      1
7:    192   1120   2464    2520    1176     196      0     -1
8:   -448  -3072  -8320  -11264   -7920   -2688   -336      0     1
9:   1024   8064  25920   43680   41184   21384   5544    540     0   -1
10: -2304 -20480 -76160 -153600 -182000 -128128 -51480 -10560  -825    0   1
... reformatted and extended. - _Wolfdieter Lang_, Feb 02 2018
		

References

  • (For references regarding interlacing roots, see A202605.)

Crossrefs

Cf. A049310, A049581, A053120, A085750 (column k=0, Det(M_n)), A166445(n-1) (alternating row sums), A202605.

Programs

  • Mathematica
    (* begin*)
    f[i_, j_] := Abs[i - j];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[6]] (* 6x6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
    {n, 1, 12}, {i, 1, n}]]  (* A049581 *)
    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[%]    (* A203993 *)
    TableForm[Table[c[n], {n, 1, 10}]]
    (* end *)
    CoefficientList[Table[CharacteristicPolynomial[SparseArray[{i_, j_} :> Abs[i - j], n], x], {n, 10}], x] //Flatten (* Eric W. Weisstein, Apr 07 2017 *)
    CoefficientList[Table[((-x)^n (x + x ChebyshevT[2 n, Sqrt[1 + 1/(2 x)]] - n ChebyshevU[n - 1, 1 + 1/x]))/(2 x), {n, 10}], x] // Flatten (* Eric W. Weisstein, Apr 07 2017 *)
    CoefficientList[Table[1/4 (2 (-x)^n + (-1 - x - Sqrt[1 + 2 x])^n + (-1 - x + Sqrt[1 + 2 x])^n + (n (-(-1 - x - Sqrt[1 + 2 x])^n + (-1 - x + Sqrt[1 + 2 x])^n))/Sqrt[1 + 2 x]), {n, 10}], x] // Flatten (* Eric W. Weisstein, Apr 07 2017 *)
    CoefficientList[LinearRecurrence[{-4 - 5 x, -2 (2 + 6 x + 5 x^2), -2 x (2 + 6 x + 5 x^2), -x^3 (4 + 5 x), -x^5}, {-x, (-1 + x) (1 + x), -(2 + x) (-2 - 2 x + x^2), (-6 - 4 x + x^2) (2 + 4 x + x^2), -(4 + 6 x + x^2) (-8 - 18 x - 6 x^2 + x^3)}, 10], x] // Flatten (* Eric W. Weisstein, Apr 07 2017 *)

Formula

T(n, k) = [x^k] p(n,x), with p(n,x) = Determinant(M_n - x*1_n), with the n x n matrix M_n with entries M_n(i, j) = |i-j|, for n >= 1, k = 0, 1, ..., n. For p(n,x) see a comment above and the Mathematica formulas by Weisstein.- Wolfdieter Lang, Feb 02 2018
Showing 1-2 of 2 results.