Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Jul 17 2023 17:14:23
%S 1,1,0,1,1,0,1,1,1,0,1,2,2,1,0,1,2,3,2,1,0,1,3,5,5,3,1,0,1,3,6,7,6,3,
%T 1,0,1,4,9,13,13,9,4,1,0,1,4,10,16,19,16,10,4,1,0,1,5,14,26,35,35,26,
%U 14,5,1,0,1,5,15,30,45,51,45,30,15,5,1,0,1,6,20,45,75,96,96,75,45,20,6,1,0
%N Triangle T(n,k), 0<=k<=n, read by rows given by [1, 0, -1, 0, 0, 0, 0, 0, ...] DELTA [0, 1, 0, -1, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.
%C A169623 is a very similar triangle except it does not have the outer diagonal of 0's. - _N. J. A. Sloane_, Nov 23 2017
%H G. C. Greubel, <a href="/A123149/b123149.txt">Rows n = 0..50 of the triangle, flattened</a>
%F T(n,k) = T(n-1,k-1) + T(n-1,k) if n even, T(n,k) = T(n-1,k-1) + T(n-2,k) if n odd, T(0,0) = 1, T(1,0) = 1, T(1,1) = 0, T(n,k) = 0 if k < 0 or if k > n.
%F T(n,k) = T(n,n-k-1).
%F Sum_{k=0..n} T(n,k) = A038754(n-1), for n>=1.
%F T(2*n,n) = A005773(n).
%F T(2*n+1,n) = A002426(n).
%F From _Philippe Deléham_, May 04 2012: (Start)
%F G.f.: (1+x-y^2*x^2)/(1-x^2-y*x^2-y^2*x^2).
%F T(n,k) = T(n-2,k) + T(n-2,k-1) + T(n-2,k-2), T(0,0) = T(1,0) = T(2,0) = T(2,1) = 1, T(1,1) = T(2,2) = 0 and T(n,k) = 0 if k < 0 or if k > n.
%F Sum_{k=0..n} T(n,k) = A182522(n). (End)
%F From _G. C. Greubel_, Jul 17 2023: (Start)
%F Sum_{k=0..n} (-1)^k*T(n,k) = A135528(n).
%F Sum_{k=0..floor(n/2)} T(n-k,k) = [n==0] + A013979(n+1). (End)
%e Triangle begins:
%e 1;
%e 1, 0;
%e 1, 1, 0;
%e 1, 1, 1, 0;
%e 1, 2, 2, 1, 0;
%e 1, 2, 3, 2, 1, 0;
%e 1, 3, 5, 5, 3, 1, 0;
%e 1, 3, 6, 7, 6, 3, 1, 0;
%e 1, 4, 9, 13, 13, 9, 4, 1, 0;
%t T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==0 || k==n-1, 1, If[k==n, 0, T[n-2,k] +T[n-2,k-1] +T[n-2,k-2] ]]];
%t Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Jul 17 2023 *)
%o (Magma)
%o function T(n,k) // T = A123149
%o if k lt 0 or k gt n then return 0;
%o elif k eq 0 or k eq n-1 then return 1;
%o elif k eq n then return 0;
%o else return T(n-2,k) +T(n-2,k-1) +T(n-2,k-2);
%o end if;
%o end function;
%o [T(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Jul 17 2023
%o (SageMath)
%o def T(n,k): # T = A123149
%o if (k<0 or k>n): return 0
%o elif (k==0 or k==n-1): return 1
%o elif (k==n): return 0
%o else: return T(n-2,k) +T(n-2,k-1) +T(n-2,k-2)
%o flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # _G. C. Greubel_, Jul 17 2023
%Y Cf. A002426, A005773, A013979, A027907, A038754, A084938, A135528, A169623, A182522 (row sums).
%K nonn,tabl,easy
%O 0,12
%A _Philippe Deléham_, Nov 05 2006