OFFSET
0,2
COMMENTS
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
FORMULA
T(n, k) = Sum_{j=0..n} binomial(n, k+j), with T(0,0) = 1 and T(n,0) = 2^n + 1. - G. C. Greubel, Nov 20 2019
T(n, k) = binomial(n, k)*hypergeom([1, k-n], [k+1], -1) - binomial(n, k+n+1)* hypergeom([1, k+1], [k+n+2], -1) + 0^k - 0^n. - Peter Luschny, Nov 20 2019
EXAMPLE
First few rows of the triangle:
1;
3, 1;
5, 3, 1;
9, 7, 4, 1;
17, 15, 11, 5, 1;
33, 31, 26, 16, 6, 1;
65, 63, 57, 42, 22, 7, 1;
...
MAPLE
T:= proc(n, k) option remember;
if k=0 and n=0 then 1
elif k=0 then 2^n +1
else add(binomial(n, k+j), j=0..n)
fi; end:
seq(seq(T(n, k), k=0..n), n=0..10); # G. C. Greubel, Nov 20 2019
MATHEMATICA
T[n_, k_]:= T[n, k] = If[k==n==0, 1, If[k==0, 2^n +1, Sum[Binomial[n, k + j], {j, 0, n}]]]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 20 2019 *)
PROG
(PARI) T(n, k) = if(k==0 && n==0, 1, if(k==0, 2^n +1, sum(j=0, n, binomial(n, k+j)) )); \\ G. C. Greubel, Nov 20 2019
(Magma)
function T(n, k)
if k eq 0 and n eq 0 then return 1;
elif k eq 0 then return 2^n +1;
else return (&+[Binomial(n, k+j): j in [0..n]]);
end if; return T; end function;
[T(n, k): k in [0..n], n in [0..10]]; // G. C. Greubel, Nov 20 2019
(Sage)
def T(n, k):
if (k==0 and n==0): return 1
elif (k==0): return 2^n + 1
else: return sum(binomial(n, k+j) for j in (0..n))
[[T(n, k) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Nov 20 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Gary W. Adamson, Nov 23 2007
STATUS
approved