OFFSET
0,3
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
FORMULA
T(n,k) = binomial(n+1,k) if n+k even. T(n,k) = binomial(n-1,k)*(n+k)/(n-k) if n+k odd. - R. J. Mathar, Sep 08 2013
EXAMPLE
First few rows of the triangle are:
1;
1, 2;
1, 3, 3;
1, 4, 5, 4;
1, 5, 10, 7, 5;
1, 6, 14, 20, 9, 6;
1, 7, 21, 30, 35, 11, 7;
1, 8, 27, 56, 55, 56, 13, 8;
1, 9, 36, 77, 126, 91, 84, 15, 9; ...
MAPLE
A125175 := proc(n, k)
if type(n+k, 'even') then
binomial(n+1, k) ;
else
binomial(n-1, k)*(n+k)/(n-k) ;
end if;
end proc: # R. J. Mathar, Sep 08 2013
MATHEMATICA
Table[If[EvenQ[n+k], Binomial[n+1, k], Binomial[n-1, k]*(n+k)/(n-k)], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Jun 05 2019 *)
PROG
(PARI) {T(n, k) = if((n+k)%2==0, binomial(n+1, k), binomial(n-1, k)* (n+k)/(n-k))}; \\ G. C. Greubel, Jun 05 2019
(Magma) [[ k eq n select n+1 else (n+k mod 2) eq 0 select Binomial(n+1, k) else Binomial(n-1, k)*(n+k)/(n-k): k in [0..n]]: n in [0..12]]; // G. C. Greubel, Jun 05 2019
(Sage)
def T(n, k):
if (mod(n+k, 2)==0): return binomial(n+1, k)
else: return binomial(n-1, k)* (n+k)/(n-k)
[[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jun 05 2019
CROSSREFS
KEYWORD
AUTHOR
Gary W. Adamson, Nov 22 2006
STATUS
approved