A125090 Triangle read by rows: T(0,0)=1; for 0<=k<=n, n>=1, T(n,k) is the coefficient of x^(n-k) in the monic characteristic polynomial of the tridiagonal n X n matrix with diagonal (0,1,1,...) and super- and subdiagonals (1,1,1,...).
1, 1, 0, 1, -1, -1, 1, -2, -1, 1, 1, -3, 0, 3, 0, 1, -4, 2, 5, -2, -1, 1, -5, 5, 6, -7, -2, 1, 1, -6, 9, 5, -15, 0, 5, 0, 1, -7, 14, 1, -25, 9, 12, -3, -1, 1, -8, 20, -7, -35, 29, 18, -15, -3, 1, 1, -9, 27, -20, -42, 63, 14, -42, 0, 7, 0, 1, -10, 35, -39, -42, 112, -14, -85, 24, 22, -4, -1, 1, -11, 44, -65, -30, 174, -84, -134, 95, 40, -26, -4
Offset: 1
Examples
Triangle starts: 1; 1, 0; 1, -1, -1; 1, -2, -1, 1; 1, -3, 0, 3, 0; 1, -4, 2, 5, -2, -1; 1, -5, 5, 6, -7, -2, 1; 1, -6, 9, 5, -15, 0, 5, 0;
Crossrefs
Cf. A104562.
Programs
-
Maple
with(linalg): m:=proc(i,j): if i=1 and j=1 then 0 elif i=j then 1 elif abs(i-j)=1 then 1 else 0 fi end: T:=proc(n,k) if n=0 and k=0 then 1 else coeff(charpoly(matrix(n,n,m),x),x,n-k) fi end: for n from 0 to 12 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
-
Mathematica
T[n_, k_] := T[n, k] = Which[n < 0, 0, n == 0, If[k == 0, 1, 0], True, T[n-1, k-1] - T[n-2, k] - If[n == 1, 0, T[n-1, k]]]; A[n_, k_] := T[n, n-k]; Table[A[n, k], {n, 0, 12}, {k, 0, n}] (* Jean-François Alcover, Jun 13 2019, after Peter Luschny *)
-
Sage
@CachedFunction def T(n, k): if n< 0: return 0 if n==0: return 1 if k == 0 else 0 h = 0 if n==1 else T(n-1, k) return T(n-1,k-1) - T(n-2, k) - h A125090 = lambda n,k: T(n, n-k) for n in (0..9): [A125090(n,k) for k in (0..n)] # Peter Luschny, Nov 20 2012
Formula
f(n,x)=(x-1)f(n-1,x)-f(n-2,x), where f(n,x) is the monic characteristic polynomial of the n X n matrix from the definition and f(0,x)=1.
Extensions
Edited by N. J. A. Sloane, Nov 29 2006
Comments