OFFSET
0,1
COMMENTS
Parity of A003983. - Jeremy Gardiner, Mar 09 2014
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n,k) = Sum_{j=0..n} [j<=k]*[j<=n-k]*(mod(j+1,2) - mod(j,2)).
T(2*n, n) - T(2*n, n+1) = (-1)^n.
T(2*n, n) = (n+1) mod 2.
Sum_{k=0..n} T(n, k) = A004524(n+3).
Sum_{k=0..floor(n/2)} T(n-k, k) = A154958(n) (diagonal sums).
From G. C. Greubel, Mar 07 2022:
T(n, n-k) = T(n, k).
Sum_{k=0..floor(n/2)} T(n, k) = floor((n+4)/4).
T(2*n+1, n) = (1+(-1)^n)/2. (End)
EXAMPLE
Triangle begins
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, 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, 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;
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1;
1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1;
MATHEMATICA
T[n_, k_]:= Sum[(Mod[j+1, 2] - Mod[j, 2]), {j, 0, Min[k, n-k]}];
Table[T[n, k], {n, 0, 20}, {k, 0, n}]//Flatten (* G. C. Greubel, Mar 07 2022 *)
PROG
(Sage)
def A154957(n, k): return sum( (j+1)%2 - j%2 for j in (0..min(k, n-k)) )
flatten([[A154957(n, k) for k in (0..n)] for n in (0..20)]) # G. C. Greubel, Mar 07 2022
CROSSREFS
KEYWORD
AUTHOR
Paul Barry, Jan 18 2009
STATUS
approved