OFFSET
0,2
LINKS
G. C. Greubel,Rows n = 0..30 of triangle, flattened
FORMULA
T(n, k) = T(n-1, k) - T(n-2, k-2), where T(0, 0) = -1, T(n, 0) = 2 and 0 <= k <= n, n >= 0. -G. C. Greubel,May 19 2019
EXAMPLE
The first few rows are
-1;
2, 0;
2, 0, 1;
2, 0, -1, 0;
2, 0, -3, 0, -1;
2, 0, -5, 0, 0, 0;
2, 0, -7, 0, 3, 0, 1;
2, 0, -9, 0, 8, 0, 1, 0;
2, 0, -11, 0, 15, 0, -2, 0, -1;
2, 0, -13, 0, 24, 0, -10, 0, -2, 0;
2, 0, -15, 0, 35, 0, -25, 0, 0, 0, 1;
MAPLE
A192011:= proc(n, k)
option remember;
if k>n or k <0 or n<0 then
0;
elif n= 0 then
-1;
elif k=0 then
2;
else
procname(n-1, k)-procname(n-2, k-2);
end if;
end proc: #R. J. Mathar,Nov 03 2011
MATHEMATICA
p[0, _] = -1; p[1, x_]:= 2x; p[n_, x_]:= p[n, x] = x*p[n-1, x] - p[n-2, x]; row[n_]:= CoefficientList[p[n, x], x]; Table[row[n] // Reverse, {n, 0, 9}] // Flatten (*Jean-François Alcover,Nov 26 2012 *)
T[n_, k_]:= If[k<0 || k>n, 0, If[n==0 && k==0, -1, If[k==0, 2, T[n-1, k] - T[n-2, k-2]]]]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (*G. C. Greubel,May 19 2019 *)
PROG
(PARI) {T(n, k) = if(k<0 || k>n, 0, if(n==0 && k==0, -1, if(k==0, 2, T(n-1, k) - T(n-2, k-2)))) };
for(n=0, 10, for(k=0, n, print1(T(n, k), "," ))) \\G. C. Greubel,May 19 2019
(Sage)
def T(n, k):
if (k<0 or k>n): return 0
elif (n==0 and k==0): return -1
elif (k==0): return 2
else: return T(n-1, k) - T(n-2, k-2)
[[T(n, k) for k in (0..n)] for n in (0..10)] #G. C. Greubel,May 19 2019
CROSSREFS
KEYWORD
AUTHOR
Paul Curtz,Jun 21 2011
STATUS
approved