OFFSET
1,4
COMMENTS
A composition of n is a finite sequence of positive integers with sum n.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.
EXAMPLE
Triangle begins:
1
1 1
2 1 1
2 3 2 1
2 6 6 1 1
0 4 9 15 3 1
0 2 16 22 22 1 1
0 0 8 37 38 41 3 1
0 0 0 26 86 69 72 2 1
0 0 0 2 78 175 124 129 3 1
0 0 0 0 14 202 367 226 213 1 1
0 0 0 0 0 52 469 750 376 395 5 1
Row n = 6 counts the following compositions:
(1,1,3,1) (1,1,4) (1,5) (3,3) (6)
(1,3,1,1) (4,1,1) (2,4) (2,2,2)
(1,1,1,2,1) (1,1,1,3) (4,2) (1,1,1,1,1,1)
(1,2,1,1,1) (1,2,2,1) (5,1)
(2,1,1,2) (1,2,3)
(3,1,1,1) (1,3,2)
(1,1,1,1,2) (1,4,1)
(1,1,2,1,1) (2,1,3)
(2,1,1,1,1) (2,3,1)
(3,1,2)
(3,2,1)
(1,1,2,2)
(1,2,1,2)
(2,1,2,1)
(2,2,1,1)
MATHEMATICA
runsres[q_]:=Length[NestWhileList[Length/@Split[#]&, q, Length[#]>1&]]-1;
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], runsres[#]==n-k&]], {n, 10}, {k, n}]
KEYWORD
nonn,tabl
AUTHOR
Gus Wiseman, Nov 21 2019
STATUS
approved