%I #22 Dec 26 2023 23:47:48
%S 3,1,3,0,1,3,0,0,1,3,0,0,0,1,3,0,0,0,0,1,3,0,0,0,0,0,1,3,0,0,0,0,0,0,
%T 1,3,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,0,1,3,0,0,
%U 0,0,0,0,0,0,0,0,1,3
%N Triangle by columns, (3, 1, 0, 0, 0, ...) in every column.
%C Infinite lower triangular matrix with (3, 3, 3, ...) in the main diagonal and (1, 1, 1, ...) in the subdiagonal, with the rest zeros.
%H G. C. Greubel, <a href="/A136157/b136157.txt">Rows n = 0..50 of the triangle, flattened</a>
%F From _G. C. Greubel_, Dec 26 2023: (Start)
%F T(n, k) = 3 if k = n, T(n, k) = 1 if k = n-1, otherwise T(n, k) = 0.
%F T(n, k) = 2 + (-1)^(n+k) for k >= n-1, otherwise T(n, k) = 0.
%F Sum_{k=0..n} T(n, k) = 4 - [n=0].
%F Sum_{k=0..n} (-1)^k*T(n, k) = (-2)^n + [n=0].
%F Sum_{k=0..floor(n/2)} T(n-k, k) = 2 + (-1)^n.
%F Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (2 + (-1)^n)*(-1)^floor(n/2). (End)
%e First few rows of the triangle:
%e 3;
%e 1, 3;
%e 0, 1, 3;
%e 0, 0, 1, 3;
%e 0, 0, 0, 1, 3;
%e 0, 0, 0, 0, 1, 3;
%e ...
%t Table[PadLeft[{1,3},n,{0}],{n,0,20}]//Flatten (* _Harvey P. Dale_, Apr 04 2018 *)
%o (Magma)
%o function T(n,k) // T = A136157
%o if k gt n-2 then return 2 + (-1)^(n+k);
%o else return 0;
%o end if;
%o end function;
%o [T(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Dec 26 2023
%o (SageMath)
%o def T(n,k): # T = A136157
%o if k>n-2: return 2 + (-1)^(n+k)
%o else: return 0
%o flatten([[T(n,k) for k in range(n+1)] for n in range(13)]) # _G. C. Greubel_, Dec 26 2023
%Y Cf. A136158.
%K nonn,tabl
%O 0,1
%A _Gary W. Adamson_, Dec 16 2007
%E Offset changed by _G. C. Greubel_, Dec 26 2023