OFFSET
0,6
COMMENTS
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
Sum_{k=0..n} T(n, k) = A097076(n+1).
From G. C. Greubel, Sep 03 2022: (Start)
T(n, k) = Sum_{j=k..n} (-1)^(n-j)*binomial(n,j)*A059576(j,k).
T(n, 0) = A059841(n).
T(n, 1) = A004526(n-1).
T(n, 2) = 2*A008805(n-2).
T(n, 3) = 4*A058187(n-3).
T(n, 4) = 8*A189976(n+4).
T(n, n) = A011782(n).
T(n, n-1) = A011782(n) - [n==0]. (End)
EXAMPLE
First few rows of the triangle =
1;
0, 1;
1, 1, 2;
0, 2, 2, 4;
1, 2, 6, 4, 8;
0, 3, 6, 16, 8, 16;
1, 3, 12, 16, 40, 16, 32;
0, 4, 12, 40, 40, 96, 32, 64;
1, 4, 20, 40, 120, 96, 224, 64, 128;
0, 5, 20, 80, 120, 336, 224, 512, 128, 256;
...
MAPLE
A059576 := proc (n, k)
if n = 0 then
return 1;
end if;
if k <= n and k >= 0 then
add((-1)^j*2^(n-j-1)*binomial(k, j)*binomial(n-j, k), j = 0 .. min(k, n-k))
else
0 ;
end if
end proc:
A157898 := proc(n, k)
end proc: # R. J. Mathar, Feb 13 2013
MATHEMATICA
t[n_, k_]:= t[n, k]= If[k==0 || k==n, 2^(n-1) +Boole[n==0]/2, 2*t[n-1, k-1] + 2*t[n-1, k] -(2 -Boole[n==2])*t[n-2, k-1]]; (* t= A059576 *)
Table[A157898[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Sep 03 2022 *)
PROG
(Magma)
A011782:= func< n | n eq 0 select 1 else 2^(n-1) >;
function t(n, k) // t = A059576
if k eq 0 or k eq n then return A011782(n);
else return 2*t(n-1, k-1) + 2*t(n-1, k) - (2 - 0^(n-2))*t(n-2, k-1);
end if; return t;
end function;
A157898:= func< n, k | (&+[(-1)^(n-j)*Binomial(n, j)*t(j, k): j in [k..n]]) >;
[A157898(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Sep 03 2022
(SageMath)
@CachedFunction
def t(n, k): # t = A059576
if (k==0 or k==n): return bool(n==0)/2 + 2^(n-1) # A011782
else: return 2*t(n-1, k-1) + 2*t(n-1, k) - (2 - 0^(n-2))*t(n-2, k-1)
def A157898(n, k): return sum((-1)^(n-j)*binomial(n, j)*t(j, k) for j in (k..n))
flatten([[A157898(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Sep 03 2022
CROSSREFS
KEYWORD
AUTHOR
Gary W. Adamson and Roger L. Bagula, Mar 08 2009
STATUS
approved