login
A354581
Numbers k such that the k-th composition in standard order is rucksack, meaning every distinct partial run has a different sum.
4
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 56, 57, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 80, 81, 82, 84, 85, 86, 88
OFFSET
0,3
COMMENTS
We define a partial run of a sequence to be any contiguous constant subsequence.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The term rucksack is short for run-knapsack.
EXAMPLE
The terms together with their corresponding compositions begin:
0: ()
1: (1)
2: (2)
3: (1,1)
4: (3)
5: (2,1)
6: (1,2)
7: (1,1,1)
8: (4)
9: (3,1)
10: (2,2)
12: (1,3)
13: (1,2,1)
15: (1,1,1,1)
Missing are:
11: (2,1,1)
14: (1,1,2)
23: (2,1,1,1)
27: (1,2,1,1)
29: (1,1,2,1)
30: (1,1,1,2)
39: (3,1,1,1)
43: (2,2,1,1)
46: (2,1,1,2)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], UnsameQ@@Total/@Union@@Subsets/@Split[stc[#]]&]
CROSSREFS
The version for binary indices is A000225.
Counting distinct sums of full runs gives A353849, partitions A353835.
For partitions we have A353866, counted by A353864, complement A354583.
These compositions are counted by A354580.
Counting distinct sums of partial runs gives A354907, partitions A353861.
A066099 lists all compositions in standard order.
A124767 counts runs in standard compositions.
A124771 counts distinct contiguous subsequences, non-contiguous A334299.
A238279 and A333755 count compositions by number of runs.
A351014 counts distinct runs in standard compositions, firsts A351015.
A353838 ranks partitions with all distinct run-sums, counted by A353837.
A353851 counts compositions with all equal run-sums, ranked by A353848.
A353852 ranks compositions with all distinct run-sums, counted by A353850.
A353853-A353859 pertain to composition run-sum trajectory.
A353932 lists run-sums of standard compositions, rows ranked by A353847.
Sequence in context: A247814 A082918 A301373 * A193096 A353744 A309129
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 15 2022
STATUS
approved