OFFSET
0,4
COMMENTS
row sums = A051049: (1, 1, 4, 7, 16, 31, 64, ...).
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
FORMULA
T(n,k) = A007318 + A000012(signed) - Identity matrix, where A000012(signed) = (1; -1,1; 1,-1,1; ...).
T(n,k) = (-1)^(n-k) + binomial(n,k), with T(n,n)=1. - G. C. Greubel, Nov 20 2019
EXAMPLE
First few rows of the triangle:
1;
0, 1;
2, 1, 1;
0, 4, 2, 1;
2, 3, 7, 3, 1;
0, 6, 9, 11, 4, 1;
2, 5, 16, 19, 16, 5, 1;
0, 8, 20, 36, 34, 22, 6, 1;
2, 7, 29, 55, 71, 55, 29, 7, 1;
...
MAPLE
seq(seq( `if`(k=n, 1, binomial(n, k) + (-1)^(n-k)), k=0..n), n=0..12); # G. C. Greubel, Nov 20 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==n, 1, Binomial[n, k] + (-1)^(n-k)] ;
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 20 2019 *)
PROG
(PARI) T(n, k) = if(k==n, 1, binomial(n, k) + (-1)^(n-k)); \\ G. C. Greubel, Nov 20 2019
(Magma) T:= func< n, k | k eq n select 1 else Binomial(n, k) +(-1)^(n-k) >;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 20 2019
(Sage)
def T(n, k):
if (k==n): return 1
else: return binomial(n, k) + (-1)^(n-k)
[[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 20 2019
(GAP)
T:= function(n, k)
if k=n then return 1;
else return Binomial(n, k) + (-1)^(n-k);
fi; end;
Flat(List([0..12], n-> List([0..n], k-> T(n, k) ))); # G. C. Greubel, Nov 20 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Gary W. Adamson, Nov 23 2007
EXTENSIONS
More terms added by G. C. Greubel, Nov 20 2019
STATUS
approved