OFFSET
0,4
COMMENTS
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
EXAMPLE
Triangle begins:
1;
1, 1;
2, 1, 1;
4, 1, 2, 1;
8, 1, 3, 3, 1;
16, 1, 4, 6, 4, 1;
32, 1, 5, 10, 10, 5, 1;
64, 1, 6, 15, 20, 15, 6, 1;
...
MAPLE
T:= proc(n, k) option remember;
if k=n then 1
elif k=0 then 2^(n-1)
else binomial(n-1, k-1)
fi; end:
seq(seq(T(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, If[k==0, 2^(n-1), Binomial[n-1, k-1]]];
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, if(k==0, 2^(n-1), binomial(n-1, k-1) )); \\ G. C. Greubel, Nov 20 2019
(Magma)
function T(n, k)
if k eq n then return 1;
elif k eq 0 then return 2^(n-1);
else return Binomial(n-1, k-1);
end if; return T; end function;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 20 2019
(Sage)
@CachedFunction
def T(n, k):
if (k==n): return 1
elif (k==0): return 2^(n-1)
else: return binomial(n-1, k-1)
[[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 20 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Jul 30 2011
STATUS
approved