login
A238130
Triangle read by rows: T(n,k) is the number of compositions into nonzero parts with k parts directly followed by a different part, n>=0, 0<=k<=n.
100
1, 1, 0, 2, 0, 0, 2, 2, 0, 0, 3, 4, 1, 0, 0, 2, 10, 4, 0, 0, 0, 4, 12, 14, 2, 0, 0, 0, 2, 22, 29, 10, 1, 0, 0, 0, 4, 26, 56, 36, 6, 0, 0, 0, 0, 3, 34, 100, 86, 31, 2, 0, 0, 0, 0, 4, 44, 148, 200, 99, 16, 1, 0, 0, 0, 0, 2, 54, 230, 374, 278, 78, 8, 0, 0, 0, 0, 0, 6, 58, 322, 680, 654, 274, 52, 2, 0, 0, 0, 0, 0
OFFSET
0,4
COMMENTS
First column (k=0) is A000005, second column (k=1) is 2*A002133.
Row sums are A011782.
LINKS
Joerg Arndt and Alois P. Heinz, Rows n = 0..140, flattened
EXAMPLE
Triangle starts:
00: 1,
01: 1, 0,
02: 2, 0, 0,
03: 2, 2, 0, 0,
04: 3, 4, 1, 0, 0,
05: 2, 10, 4, 0, 0, 0,
06: 4, 12, 14, 2, 0, 0, 0,
07: 2, 22, 29, 10, 1, 0, 0, 0,
08: 4, 26, 56, 36, 6, 0, 0, 0, 0,
09: 3, 34, 100, 86, 31, 2, 0, 0, 0, 0,
10: 4, 44, 148, 200, 99, 16, 1, 0, 0, 0, 0,
11: 2, 54, 230, 374, 278, 78, 8, 0, 0, 0, 0, 0,
12: 6, 58, 322, 680, 654, 274, 52, 2, 0, 0, 0, 0, 0,
13: 2, 74, 446, 1122, 1390, 814, 225, 22, 1, 0, 0, 0, 0, 0,
...
Row 5 is [2, 10, 4, 0, 0, 0] because in the 16 compositions of 5
##: [composition] no. of changes
01: [ 1 1 1 1 1 ] 0
02: [ 1 1 1 2 ] 1
03: [ 1 1 2 1 ] 2
04: [ 1 1 3 ] 1
05: [ 1 2 1 1 ] 2
06: [ 1 2 2 ] 1
07: [ 1 3 1 ] 2
08: [ 1 4 ] 1
09: [ 2 1 1 1 ] 1
10: [ 2 1 2 ] 2
11: [ 2 2 1 ] 1
12: [ 2 3 ] 1
13: [ 3 1 1 ] 1
14: [ 3 2 ] 1
15: [ 4 1 ] 1
16: [ 5 ] 0
there are 2 with no changes, 10 with one change, and 4 with two changes.
MAPLE
b:= proc(n, v) option remember; `if`(n=0, 1, expand(
add(b(n-i, i)*`if`(v=0 or v=i, 1, x), i=1..n)))
end:
T:= n-> seq(coeff(b(n, 0), x, i), i=0..n):
seq(T(n), n=0..14);
MATHEMATICA
b[n_, v_] := b[n, v] = If[n == 0, 1, Sum[b[n-i, i]*If[v == 0 || v == i, 1, x], {i, 1, n}]]; T[n_] := Table[Coefficient[b[n, 0], x, i], {i, 0, n}]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 12 2015, translated from Maple *)
CROSSREFS
Cf. A238279 (same sequence with zeros omitted).
Cf. A106356 (compositions with k successive parts same).
Cf. A225084 (compositions with maximal up-step k).
Sequence in context: A333941 A137676 A333755 * A238707 A181111 A353856
KEYWORD
nonn,tabl
AUTHOR
Joerg Arndt and Alois P. Heinz, Feb 21 2014
STATUS
approved