%I #54 Oct 28 2024 04:51:49
%S 1,0,1,0,2,1,0,2,4,1,0,2,8,6,1,0,2,12,18,8,1,0,2,16,38,32,10,1,0,2,20,
%T 66,88,50,12,1,0,2,24,102,192,170,72,14,1,0,2,28,146,360,450,292,98,
%U 16,1,0,2,32,198,608,1002,912,462,128,18,1
%N Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, 2, -1, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.
%C Riordan array (1, x*(1+x)/(1-x)). Rising and falling diagonals are the tribonacci numbers A000213, A001590.
%H Reinhard Zumkeller, <a href="/A122542/b122542.txt">Rows n = 0..120 of triangle, flattened</a>
%H Bela Bajnok, <a href="https://arxiv.org/abs/1705.07444">Additive Combinatorics: A Menu of Research Problems</a>, arXiv:1705.07444 [math.NT], May 2017. See Sect. 2.3.
%H Huyile Liang, Yanni Pei, and Yi Wang, <a href="https://arxiv.org/abs/2302.11856">Analytic combinatorics of coordination numbers of cubic lattices</a>, arXiv:2302.11856 [math.CO], 2023. See p. 1.
%F Sum_{k=0..n} x^k*T(n,k) = A000007(n), A001333(n), A104934(n), A122558(n), A122690(n), A091928(n) for x = 0, 1, 2, 3, 4, 5. - _Philippe Deléham_, Jan 25 2012
%F Sum_{k=0..n} 3^(n-k)*T(n,k) = A086901(n).
%F Sum_{k=0..n} 2^(n-k)*T(n,k) = A007483(n-1), n >= 1. - _Philippe Deléham_, Oct 08 2006
%F T(2*n, n) = A123164(n).
%F T(n, k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k-1), n > 1. - _Philippe Deléham_, Jan 25 2012
%F G.f.: (1-x)/(1-(1+y)*x-y*x^2). - _Philippe Deléham_, Mar 02 2012
%F From _G. C. Greubel_, Oct 27 2024: (Start)
%F Sum_{k=0..n} (-1)^k*T(n, k) = A057077(n).
%F Sum_{k=0..floor(n/2)} T(n-k, k) = A001590(n+1).
%F Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = A078016(n). (End)
%e Triangle begins:
%e 1;
%e 0, 1;
%e 0, 2, 1;
%e 0, 2, 4, 1;
%e 0, 2, 8, 6, 1;
%e 0, 2, 12, 18, 8, 1;
%e 0, 2, 16, 38, 32, 10, 1;
%e 0, 2, 20, 66, 88, 50, 12, 1;
%e 0, 2, 24, 102, 192, 170, 72, 14, 1;
%e 0, 2, 28, 146, 360, 450, 292, 98, 16, 1;
%e 0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1;
%t CoefficientList[#, y]& /@ CoefficientList[(1-x)/(1 - (1+y)x - y x^2) + O[x]^11, x] // Flatten (* _Jean-François Alcover_, Sep 09 2018 *)
%t (* Second program *)
%t T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, 0, T[n-1,k-1] +T[n-1,k] +T[n-2,k- 1] ]]; (* T = A122542 *)
%t Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Oct 27 2024 *)
%o (Haskell)
%o a122542 n k = a122542_tabl !! n !! k
%o a122542_row n = a122542_tabl !! n
%o a122542_tabl = map fst $ iterate
%o (\(us, vs) -> (vs, zipWith (+) ([0] ++ us ++ [0]) $
%o zipWith (+) ([0] ++ vs) (vs ++ [0]))) ([1], [0, 1])
%o -- _Reinhard Zumkeller_, Jul 20 2013, Apr 17 2013
%o (Sage)
%o def A122542_row(n):
%o @cached_function
%o def prec(n, k):
%o if k==n: return 1
%o if k==0: return 0
%o return prec(n-1,k-1)+2*sum(prec(n-i,k-1) for i in (2..n-k+1))
%o return [prec(n, k) for k in (0..n)]
%o for n in (0..10): print(A122542_row(n)) # _Peter Luschny_, Mar 16 2016
%o (Magma)
%o function T(n, k) // T = A122542
%o if k eq 0 then return 0^n;
%o elif k eq n then return 1;
%o else return T(n-1,k) + T(n-1,k-1) + T(n-2,k-1);
%o end if;
%o end function;
%o [T(n, k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Oct 27 2024
%Y Other versions: A035607, A113413, A119800, A266213.
%Y Diagonals: A000012, A005843, A001105, A035597 - A035606.
%Y Columns: A000007, A040000, A008575, A005899, A008412-A008416, A008418, A008420, A035706 - A035745.
%Y Sums include: A000007, A001333 (row), A001590 (diagonal), A007483, A057077 (signed row), A078016 (signed diagonal), A086901, A091928, A104934, A122558, A122690.
%Y Cf. A155161, A059283.
%K nonn,tabl,changed
%O 0,5
%A _Philippe Deléham_, Sep 19 2006, May 28 2007