A354912 Numbers k such that the k-th composition in standard order is the sequence of run-sums of some other composition.
0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 16, 17, 18, 20, 21, 22, 24, 25, 26, 32, 33, 34, 36, 37, 38, 40, 41, 42, 44, 45, 48, 49, 50, 52, 54, 64, 65, 66, 68, 69, 70, 72, 73, 74, 76, 77, 80, 81, 82, 84, 85, 86, 88, 89, 90, 96, 97, 98, 100, 101, 102, 104, 105, 106, 108
Offset: 0
Keywords
Examples
The terms and their corresponding compositions begin: 0: () 1: (1) 2: (2) 4: (3) 5: (2,1) 6: (1,2) 8: (4) 9: (3,1) 10: (2,2) 12: (1,3) 13: (1,2,1) 16: (5) 17: (4,1) 18: (3,2) 20: (2,3) 21: (2,2,1) 22: (2,1,2) For example, the 21st composition in standard order (2,2,1) equals the run-sums of (1,1,2,1), so 21 is in the sequence. On the other hand, no composition has run-sums equal to the 29th composition (1,1,2,1), so 29 is not in the sequence.
Crossrefs
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Select[Range[0,100],MemberQ[Total/@Split[#]&/@ Join@@Permutations/@IntegerPartitions[Total[stc[#]]],stc[#]]&]
Comments