A354581 Numbers k such that the k-th composition in standard order is rucksack, meaning every distinct partial run has a different sum.
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
Keywords
Examples
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)
Crossrefs
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Select[Range[0,100],UnsameQ@@Total/@Union@@Subsets/@Split[stc[#]]&]
Comments