login
A symmetric (0,1)-triangle.
5

%I #13 Mar 08 2022 02:03:34

%S 1,1,1,1,0,1,1,0,0,1,1,0,1,0,1,1,0,1,1,0,1,1,0,1,0,1,0,1,1,0,1,0,0,1,

%T 0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,1,0,

%U 1,0,1,0,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1

%N A symmetric (0,1)-triangle.

%C Parity of A003983. - _Jeremy Gardiner_, Mar 09 2014

%H G. C. Greubel, <a href="/A154957/b154957.txt">Rows n = 0..50 of the triangle, flattened</a>

%F T(n,k) = Sum_{j=0..n} [j<=k]*[j<=n-k]*(mod(j+1,2) - mod(j,2)).

%F T(2*n, n) - T(2*n, n+1) = (-1)^n.

%F T(2*n, n) = (n+1) mod 2.

%F Sum_{k=0..n} T(n, k) = A004524(n+3).

%F Sum_{k=0..floor(n/2)} T(n-k, k) = A154958(n) (diagonal sums).

%F From _G. C. Greubel_, Mar 07 2022:

%F T(n, n-k) = T(n, k).

%F Sum_{k=0..floor(n/2)} T(n, k) = floor((n+4)/4).

%F T(2*n+1, n) = (1+(-1)^n)/2. (End)

%e Triangle begins

%e 1;

%e 1, 1;

%e 1, 0, 1;

%e 1, 0, 0, 1;

%e 1, 0, 1, 0, 1;

%e 1, 0, 1, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;

%e 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1;

%t T[n_, k_]:= Sum[(Mod[j+1,2] - Mod[j,2]), {j,0,Min[k,n-k]}];

%t Table[T[n, k], {n,0,20}, {k,0,n}]//Flatten (* _G. C. Greubel_, Mar 07 2022 *)

%o (Sage)

%o def A154957(n,k): return sum( (j+1)%2 - j%2 for j in (0..min(k,n-k)) )

%o flatten([[A154957(n,k) for k in (0..n)] for n in (0..20)]) # _G. C. Greubel_, Mar 07 2022

%Y Cf. A003983, A004524 (row sums), A154958 (diagonal sums), A158856.

%K easy,nonn,tabl

%O 0,1

%A _Paul Barry_, Jan 18 2009