%I #14 Sep 18 2024 11:23:52
%S 0,0,-1,0,-2,1,0,-3,1,-2,0,-4,1,-3,2,0,-5,1,-4,2,-3,0,-6,1,-5,2,-4,3,
%T 0,-7,1,-6,2,-5,3,-4,0,-8,1,-7,2,-6,3,-5,4,0,-9,1,-8,2,-7,3,-6,4,-5,0,
%U -10,1,-9,2,-8,3,-7,4,-6,5
%N Triangle T(n,k) read by brows: T(n,2k)=k, T(n,2k+1) = k-n, for 0<=k<=n.
%C In each row, two bisections count up.
%H G. C. Greubel, <a href="/A141543/b141543.txt">Rows n = 0..50 of the triangle, flattened</a>
%F From _G. C. Greubel_, Sep 17 2024: (Start)
%F T(n, k) = (1/2)*((1+(-1)^k)*floor(k/2) + (1-(-1)^k)*(-n + floor((k - 1)/2)) ).
%F T(n, n) = A130472(n).
%F T(2*n, n) = (-1)^n*A014682(n).
%F Sum_{k=0..n} T(n, k) = (-1)*A008794(n+1).
%F Sum_{k=0..n} (-1)^k*T(n, k) = A000217(n).
%F Sum_{k=0..floor(n/2)} T(n-k, k) = A159915(n+1).
%F Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (1/32)*(6*n^2 + 6*n - 5 + (-1)^n*(2*n + 1) + 2*(1 - i)*(-i)^n + 2*(1 + i)*i^n). (End)
%e Triangle begins as:
%e 0;
%e 0, -1;
%e 0, -2, 1;
%e 0, -3, 1, -2;
%e 0, -4, 1, -3, 2;
%e 0, -5, 1, -4, 2, -3;
%e 0, -6, 1, -5, 2, -4, 3;
%p A141543 := proc(n,k) if type(k,'even') then k/2; else (k-1)/2-n ; end if; end proc:
%p seq(seq(A141543(n,k),k=0..n),n=0..15) ; # _R. J. Mathar_, Jul 07 2011
%t Flatten[Table[If[EvenQ[k],k/2,(k-1)/2-n],{n,0,10},{k,0,n}]] (* _Harvey P. Dale_, Sep 24 2013 *)
%o (Magma)
%o A141543:= func< n,k | ((k+1) mod 2)*Floor(k/2) + (k mod 2)*(-n + Floor((k-1)/2)) >;
%o [A141543(n,k): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Sep 17 2024
%o (SageMath)
%o def A141543(n,k): return ((k+1)%2)*(k//2) + (k%2)*(-n + ((k-1)//2))
%o flatten([[A141543(n,k) for k in range(n+1)] for n in range(16)]) # _G. C. Greubel_, Sep 17 2024
%Y Sums include: A000217 (signed row), A008794 (row), A159915 (diagonal).
%Y Cf. A014682, A130472.
%K sign,easy,tabl
%O 0,5
%A _Paul Curtz_, Aug 16 2008