OFFSET
0,3
LINKS
Alois P. Heinz, Rows n = 0..100, flattened
FORMULA
From G. C. Greubel, Mar 27 2023: (Start)
T(n, k) = Sum_{j=0..k} binomial(n, k-j)*binomial(k-j, j)*2^(k-2*j)*3^j.
T(n, n) = A084609(n).
T(n, 2*n-1) = A212697(n), n >= 1.
T(n, 2*n) = A000244(n).
Sum_{j=0..2*n} T(n, k) = A000400(n).
Sum_{k=0..2*n} (-1)^k*T(n, k) = A000079(n).
Sum_{k=0..n} T(n-k, k) = A101822(n). (End)
EXAMPLE
Triangle begins:
1;
1, 2, 3;
1, 4, 10, 12, 9;
1, 6, 21, 44, 63, 54, 27;
1, 8, 36, 104, 214, 312, 324, 216, 81;
1, 10, 55, 200, 530, 1052, 1590, 1800, 1485, 810, 243;
MAPLE
f:= proc(n) option remember; expand((1+2*x+3*x^2)^n) end:
T:= (n, k)-> coeff(f(n), x, k):
seq(seq(T(n, k), k=0..2*n), n=0..10); # Alois P. Heinz, Apr 03 2011
MATHEMATICA
row[n_] := (1+2x+3x^2)^n + O[x]^(2n+1) // CoefficientList[#, x]&; Table[row[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Feb 01 2017 *)
PROG
(PARI) for(n=0, 10, for(k=0, 2*n, t=polcoeff((1+2*x+3*x^2)^n, k, x); print1(t", ")); print(" "))
(Haskell)
a084608 n = a084608_list !! n
a084608_list = concat $ iterate ([1, 2, 3] *) [1]
instance Num a => Num [a] where
fromInteger k = [fromInteger k]
(p:ps) + (q:qs) = p + q : ps + qs
ps + qs = ps ++ qs
(p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
_ * _ = []
-- Reinhard Zumkeller, Apr 02 2011
(Magma)
A084608:= func< n, k | (&+[Binomial(n, k-j)*Binomial(k-j, j)*2^(k-2*j)*3^j: j in [0..k]]) >;
[A084608(n, k): k in [0..2*n], n in [0..13]]; // G. C. Greubel, Mar 27 2023
(SageMath)
def A084608(n, k): return sum(binomial(n, j)*binomial(n-j, k-2*j)*2^(k-2*j)*3^j for j in range(k//2+1))
flatten([[A084608(n, k) for k in range(2*n+1)] for n in range(14)]) # G. C. Greubel, Mar 27 2023
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Paul D. Hanna, Jun 01 2003
STATUS
approved