[go: up one dir, main page]

login
A242498
Number T(n,k) of compositions of n, where k is the difference between the number of odd parts and the number of even parts; triangle T(n,k), n>=0, -floor(n/2)+(n mod 2)<=k<=n, read by rows.
14
1, 1, 1, 0, 0, 1, 2, 1, 0, 1, 1, 1, 0, 3, 2, 0, 1, 3, 4, 1, 4, 3, 0, 1, 1, 2, 1, 6, 9, 3, 5, 4, 0, 1, 4, 9, 6, 11, 16, 6, 6, 5, 0, 1, 1, 3, 3, 11, 24, 18, 19, 25, 10, 7, 6, 0, 1, 5, 16, 18, 28, 51, 40, 31, 36, 15, 8, 7, 0, 1, 1, 4, 6, 19, 51, 60, 65, 95, 75, 48, 49, 21, 9, 8, 0, 1
OFFSET
0,7
COMMENTS
T(n,k) = T(n+k,-k).
LINKS
EXAMPLE
Triangle T(n,k) begins:
: n\k : -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 ...
+-----+---------------------------------------------------------
: 0 : 1;
: 1 : 1;
: 2 : 1, 0, 0, 1;
: 3 : 2, 1, 0, 1;
: 4 : 1, 1, 0, 3, 2, 0, 1;
: 5 : 3, 4, 1, 4, 3, 0, 1;
: 6 : 1, 2, 1, 6, 9, 3, 5, 4, 0, 1;
: 7 : 4, 9, 6, 11, 16, 6, 6, 5, 0, 1;
: 8 : 1, 3, 3, 11, 24, 18, 19, 25, 10, 7, 6, 0, 1;
: 9 : 5, 16, 18, 28, 51, 40, 31, 36, 15, 8, 7, 0, 1;
: 10 : 1, 4, 6, 19, 51, 60, 65, 95, 75, 48, 49, 21, 9, 8, 0, 1;
MAPLE
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0, expand(
add(x^(j*(2*irem(i, 2)-1))*b(n-i*j, i-1, p+j)/j!, j=0..n/i))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(b(n$2, 0)):
seq(T(n), n=0..20);
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n == 0, p!, If[i<1, 0, Expand[Sum[x^(j*(2*Mod[i, 2]-1))*b[n-i*j, i-1, p+j]/j!, {j, 0, n/i}]]]] ; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, Exponent[p, x, Min], Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Alois P. Heinz *)
CROSSREFS
Row sums give A011782.
Diagonals include: A000012, A000004, A001477, A000217, A000290, A180415.
Row lengths give A016777(floor(n/2)).
Sequence in context: A088705 A065712 A153172 * A321927 A016194 A258139
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, May 16 2014
STATUS
approved