login
A125693
Riordan array ((1-x)/(1-3*x), x*(1-x)/(1-3*x)).
2
1, 2, 1, 6, 4, 1, 18, 16, 6, 1, 54, 60, 30, 8, 1, 162, 216, 134, 48, 10, 1, 486, 756, 558, 248, 70, 12, 1, 1458, 2592, 2214, 1168, 410, 96, 14, 1, 4374, 8748, 8478, 5160, 2150, 628, 126, 16, 1, 13122, 29160, 31590, 21744, 10442, 3624, 910, 160, 18, 1
OFFSET
0,2
COMMENTS
Row sums are A001835(n+1). Diagonal sums are A030186. Inverse is A125694. Equal to product of A007318 and A073370.
FORMULA
Number triangle T(n,k) = Sum_{j=0..k+1} C(k+1,j)*C(n-j,n-k-j)* (-1)^j * 3^(n-k-j).
T(n,k) = 3*T(n-1,k) + T(n-1,k-1) - T(n-2,k-1), T(0,0)=1, T(1,0)=2, T(1,1)=1, T(n,k)=0 if k>n or if k<n. - Philippe Deléham, Jan 08 2013
EXAMPLE
Triangle begins
1;
2, 1;
6, 4, 1;
18, 16, 6, 1;
54, 60, 30, 8, 1;
162, 216, 134, 48, 10, 1;
MAPLE
seq(seq( add( (-1)^j*3^(n-k-j)*binomial(k+1, j)*binomial(n-j, n-k-j), j=0..n), k=0..n), n=0..10); # G. C. Greubel, Oct 28 2019
MATHEMATICA
T[0, 0]=1; T[1, 0]=2; T[1, 1]=1; T[n_, k_]/; 0<=k<=n:= T[n, k]= 3T[n-1, k] + T[n-1, k-1] - T[n-2, k-1]; T[_, _]=0; Table[T[n, k], {n, 0, 9}, {k, 0, n}] (* Jean-François Alcover, Jun 13 2019 *)
T[n_, k_]:= Sum[(-1)^j*3^(n-k-j)*Binomial[k+1, j]*Binomial[n-j, n-k-j], {j, 0, n}]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Oct 28 2019 *)
PROG
(PARI) T(n, k) = sum(j=0, n, (-1)^j*3^(n-k-j)*binomial(k+1, j)*binomial(n-j, n-k-j));
for(n=0, 10, for(k=0, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Oct 28 2019
(Magma) T:= func< n, k | &+[(-1)^j*3^(n-k-j)*Binomial(k+1, j)*Binomial(n-j, n-k-j): j in [0..n]] >;
[T(n, k): k in [0..n], n in [0..10]]; // G. C. Greubel, Oct 28 2019
(Sage) [[sum( (-1)^j*3^(n-k-j)*binomial(k+1, j)*binomial(n-j, n-k-j) for j in (0..n) ) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Oct 28 2019
(GAP) Flat(List([0..10], n-> List([0..n], k-> Sum([0..n], j->
(-1)^j*3^(n-k-j)*Binomial(k+1, j)*Binomial(n-j, n-k-j) )))); # G. C. Greubel, Oct 28 2019
CROSSREFS
Sequence in context: A118040 A073387 A259099 * A094527 A054335 A110681
KEYWORD
nonn,tabl,easy
AUTHOR
Paul Barry, Nov 30 2006
STATUS
approved