%I #21 Nov 11 2022 18:42:44
%S 1,0,1,0,0,1,0,1,0,1,0,0,2,0,1,0,0,0,3,0,1,0,0,2,0,4,0,1,0,0,0,5,0,5,
%T 0,1,0,0,0,0,9,0,6,0,1,0,0,0,5,0,14,0,7,0,1,0,0,0,0,14,0,20,0,8,0,1,0,
%U 0,0,0,0,28,0,27,0,9,0,1,0,0,0,0,14,0,48,0,35,0,10,0,1,0,0,0,0,0,42,0,75,0,44,0,11,0,1
%N An aerated Catalan triangle.
%C Aeration of A120730. Row sums are A165407.
%C T(n,k) is the number of lattice paths from (0,0) to (k,(n-k)/2) that do not go above the diagonal x=y using steps in {(1,0), (0,1)}. - _Alois P. Heinz_, Sep 20 2022
%H Alois P. Heinz, <a href="/A165408/b165408.txt">Rows n = 0..200, flattened</a>
%F T(n,k) = if(n<=3k, C((n+k)/2, k)*((3*k-n)/2 + 1)*(1 + (-1)^(n-k))/(2*(k+1)), 0).
%F G.f.: 1/(1-x*y-x^3*y/(1-x^3*y/(1-x^3*y/(1-x^3*y/(1-... (continued fraction).
%F Sum_{k=0..n} T(n, k) = A165407(n).
%F From _G. C. Greubel_, Nov 09 2022: (Start)
%F Sum_{k=0..floor(n/2)} T(n-k, k) = (1+(-1)^n)*A001405(n/2)/2.
%F Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (1+(-1)^n)*A105523(n/2)/2.
%F Sum_{k=0..n} (-1)^k*T(n, k) = (-1)^n*A165407(n).
%F Sum_{k=0..n} 2^k*T(n, k) = A165409(n).
%F T(n, n-2) = A001477(n-2), n >= 2.
%F T(2*n, n) = (1+(-1)^n)*A174687(n/2)/2.
%F T(2*n, n+1) = (1-(-1)^n)*A262394(n/2)/2.
%F T(2*n, n-1) = (1+(-1)^n)*A236194(n/2)/2
%F T(3*n-2, n) = A000108(n), n >= 1. (End)
%e Triangle T(n,k) begins:
%e 1;
%e 0, 1;
%e 0, 0, 1;
%e 0, 1, 0, 1;
%e 0, 0, 2, 0, 1;
%e 0, 0, 0, 3, 0, 1;
%e 0, 0, 2, 0, 4, 0, 1;
%e 0, 0, 0, 5, 0, 5, 0, 1;
%e 0, 0, 0, 0, 9, 0, 6, 0, 1;
%e 0, 0, 0, 5, 0, 14, 0, 7, 0, 1;
%e 0, 0, 0, 0, 14, 0, 20, 0, 8, 0, 1;
%e 0, 0, 0, 0, 0, 28, 0, 27, 0, 9, 0, 1;
%e 0, 0, 0, 0, 14, 0, 48, 0, 35, 0, 10, 0, 1;
%e ...
%p b:= proc(x, y) option remember; `if`(y<=x, `if`(x=0, 1,
%p b(x-1, y)+`if`(y>0, b(x, y-1), 0)), 0)
%p end:
%p T:= (n, k)-> `if`((n-k)::even, b(k, (n-k)/2), 0):
%p seq(seq(T(n, k), k=0..n), n=0..14); # _Alois P. Heinz_, Sep 20 2022
%t b[x_, y_]:= b[x, y]= If[y<=x, If[x==0, 1, b[x-1, y] + If[y>0, b[x, y-1], 0]], 0];
%t T[n_, k_]:= If[EvenQ[n-k], b[k, (n-k)/2], 0];
%t Table[T[n, k], {n,0,14}, {k,0,n}]//Flatten (* _Jean-François Alcover_, Oct 08 2022, after _Alois P. Heinz_ *)
%o (Magma)
%o A165408:= func< n,k | n le 3*k select Binomial(Floor((n+k)/2), k)*((3*k-n)/2 +1)*(1+(-1)^(n-k))/(2*(k+1)) else 0 >;
%o [A165408(n,k): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Nov 09 2022
%o (SageMath)
%o def A165408(n,k): return 0 if (n>3*k) else binomial(int((n+k)/2), k)*((3*k-n+2)/2 )*(1+(-1)^(n-k))/(2*(k+1))
%o flatten([[A165408(n,k) for k in range(n+1)] for n in range(16)]) # _G. C. Greubel_, Nov 09 2022
%Y Cf. A000108, A001405, A001477, A105523, A120730, A165407 (row sums), A165409.
%Y Cf. A174687, A236194, A262394.
%K nonn,tabl,easy
%O 0,13
%A _Paul Barry_, Sep 17 2009