|
| |
|
|
A131044
|
|
Triangle T(n,k) read by rows: T(n,k) is the number of compositions of n into k parts such that at least two adjacent parts are equal.
|
|
1
| |
|
|
1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 0, 4, 4, 1, 1, 1, 3, 8, 5, 1, 1, 0, 6, 14, 14, 6, 1, 1, 1, 6, 21, 32, 21, 7, 1, 1, 0, 7, 32, 55, 54, 28, 8, 1, 1, 1, 8, 38, 96, 116, 83, 36, 9, 1, 1, 0, 10, 54, 142, 222, 206, 120, 45, 10, 1, 1, 1, 9, 65, 211, 386, 438, 328, 165, 55, 11, 1
(list; table; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,9
|
|
|
COMMENTS
| Condition is void for compositions into 1 part (there is one such composition).
Triangle = Pascal's triangle (A007318) - A106351, except for first column.
|
|
|
EXAMPLE
| T(5,3)=4 because among the 6 compositions of 5 into 3 parts there are 4 with one part repeated, marked by (*) between the parts:
[ 3 1*1 ], [ 2*2 1 ], [ 1 3 1 ], [ 2 1 2 ], [ 1 2*2 ], [ 1*1 3 ].
Triangle begins
1;
1, 1;
1, 0, 1;
1, 1, 2, 1;
1, 0, 4, 4, 1;
1, 1, 3, 8, 5, 1;
1, 0, 6, 14, 14, 6, 1;
1, 1, 6, 21, 32, 21, 7, 1;
|
|
|
PROG
| (Sage)
def A131044_r(n, k):
....allowed = lambda x: len(x) <= 1 or 0 in differences(x)
....return Compositions(n, length=k).filter(allowed).cardinality() # [D. S. McNeil, Jan 06 2011]
|
|
|
CROSSREFS
| Cf. A106351 (no two adjacent parts are equal).
Sequence in context: A191347 A106234 A062507 * A077875 A198237 A122049
Adjacent sequences: A131041 A131042 A131043 * A131045 A131046 A131047
|
|
|
KEYWORD
| nonn,tabl,changed
|
|
|
AUTHOR
| Joerg Arndt (arndt(AT)jjj.de), Jan 06 2011
|
| |
|
|