A124762 Number of levels for compositions in standard order.
0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 1, 3, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 1, 1, 1, 1, 2, 4, 0, 0, 0, 1, 1, 0, 0, 2, 0, 0, 2, 2, 0, 0, 1, 3, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 2, 2, 2, 3, 5, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 1, 1, 0, 0, 1, 3, 0, 0, 0, 1, 1, 2, 1, 3, 0, 0, 1, 1, 1, 1, 2, 4, 0, 0, 0, 1, 1, 0, 0, 2, 0
Offset: 0
Examples
Composition number 11 is 2,1,1; 2>1=1, so a(11) = 1. The table starts: 0 0 0 1 0 0 0 2 0 0 1 1 0 0 1 3 0 0 0 1 0 1 0 2 0 0 1 1 1 1 2 4 0 0 0 1 1 0 0 2 0 0 2 2 0 0 1 3 0 0 0 1 0 1 0 2 1 1 2 2 2 2 3 5
Crossrefs
Anti-runs summing to n are counted by A003242(n).
A triangle counting maximal anti-runs of compositions is A106356.
A triangle counting maximal runs of compositions is A238279.
Partitions whose first differences are an anti-run are A238424.
All of the following pertain to compositions in standard order (A066099):
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Adjacent unequal pairs are counted by A333382.
- Anti-runs are A333489.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Length[Select[Partition[stc[n],2,1],SameQ@@#&]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)
Formula
For a composition b(1),...,b(k), a(n) = Sum_{1<=i=1
For n > 0, a(n) = A333381(n) - 1. - Gus Wiseman, Apr 08 2020
A225620 Indices of partitions in the table of compositions of A228351.
1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 40, 42, 48, 52, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 100, 104, 106, 112, 116, 120, 122, 124, 126, 127, 128, 136, 144, 160, 164, 168, 170, 192, 200, 208, 212, 224, 228, 232, 234, 240, 244, 248, 250, 252, 254, 255
Offset: 1
Comments
Also triangle read by rows in which T(n,k) is the decimal representation of a binary number whose mirror represents the k-th partition of n according with the list of juxtaposed reverse-lexicographically ordered partitions of the positive integers (A026792).
In order to construct this sequence as a triangle we use the following rules:
- In the list of A026792 we replace each part of size j of the k-th partition of n by concatenation of j - 1 zeros and only one 1.
- Then replace this new set of parts by the concatenation of its parts.
- Then replace this string by its mirror version which is a binary number.
T(n,k) is the decimal value of this binary number, which represents the k-th partition of n (see example).
The partitions of n are represented by a subsequence with A000041(n) integers starting with 2^(n-1) and ending with 2^n - 1, n >= 1. The odd numbers of the sequence are in A000225.
First differs from A065609 at a(23).
Conjecture: this sequence is a sorted version of b(n) where b(2^k) = 2^k for k >= 0, b(n) = A080100(n)*(2*b(A053645(n)) + 1) otherwise. - Mikhail Kurkov, Oct 21 2023
Examples
T(6,8) = 58 because 58 in base 2 is 111010 whose mirror is 010111 which is the concatenation of 01, 01, 1, 1, whose number of digits are 2, 2, 1, 1, which are also the 8th partition of 6.
Illustration of initial terms:
The sequence represents a table of partitions (see below):
--------------------------------------------------------
. Binary Partitions
n k T(n,k) number Mirror Diagram (A026792)
. 1 2 3 4 5 6
--------------------------------------------------------
. _
1 1 1 1 1 | 1,
. _ _
1 1 2 10 01 _ | 2,
2 2 3 11 11 | | 1,1,
. _ _ _
3 1 4 100 001 _ _ | 3,
3 2 6 110 011 _ | | 2,1,
3 3 7 111 111 | | | 1,1,1,
. _ _ _ _
4 1 8 1000 0001 _ _ | 4,
4 2 10 1010 0101 _ _|_ | 2,2,
4 3 12 1100 0011 _ _ | | 3,1,
4 4 14 1110 0111 _ | | | 2,1,1,
4 5 15 1111 1111 | | | | 1,1,1,1,
. _ _ _ _ _
5 1 16 10000 00001 _ _ _ | 5,
5 2 20 10100 00101 _ _ _|_ | 3,2,
5 3 24 11000 00011 _ _ | | 4,1,
5 4 26 11010 01011 _ _|_ | | 2,2,1,
5 5 28 11100 00111 _ _ | | | 3,1,1,
5 6 30 11110 01111 _ | | | | 2,1,1,1,
5 7 31 11111 11111 | | | | | 1,1,1,1,1,
. _ _ _ _ _ _
6 1 32 100000 000001 _ _ _ | 6
6 2 36 100100 001001 _ _ _|_ | 3,3,
6 3 40 101000 000101 _ _ | | 4,2,
6 4 42 101010 010101 _ _|_ _|_ | 2,2,2,
6 5 48 110000 000011 _ _ _ | | 5,1,
6 6 52 110100 001011 _ _ _|_ | | 3,2,1,
6 7 56 111000 000111 _ _ | | | 4,1,1,
6 8 58 111010 010111 _ _|_ | | | 2,2,1,1,
6 9 60 111100 001111 _ _ | | | | 3,1,1,1,
6 10 62 111110 011111 _ | | | | | 2,1,1,1,1,
6 11 63 111111 111111 | | | | | | 1,1,1,1,1,1,
.
Triangle begins:
1;
2, 3;
4, 6, 7;
8, 10, 12, 14, 15;
16, 20, 24, 26, 28, 30, 31;
32, 36, 40, 42, 48, 52, 56, 58, 60, 62, 63;
...
From _Gus Wiseman_, Apr 01 2020: (Start)
Using the encoding of A066099, this sequence ranks all finite nonempty multisets, as follows.
1: {1}
2: {2}
3: {1,1}
4: {3}
6: {1,2}
7: {1,1,1}
8: {4}
10: {2,2}
12: {1,3}
14: {1,1,2}
15: {1,1,1,1}
16: {5}
20: {2,3}
24: {1,4}
26: {1,2,2}
28: {1,1,3}
30: {1,1,1,2}
31: {1,1,1,1,1}
(End)
Crossrefs
Cf. A026792, A065609, A135010, A141285, A186114, A194446, A194546, A206437, A207779, A211978, A225600, A225610, A228351.
All of the following pertain to compositions in the order of A066099.
- The weakly increasing version is this sequence.
- The weakly decreasing version is A114994.
- The strictly increasing version is A333255.
- The strictly decreasing version is A333256.
- The unequal version is A233564.
- The equal version is A272919.
- The case covering an initial interval is A333217.
- Initial intervals are ranked by A164894.
- Reversed initial intervals are ranked by A246534.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Select[Range[0,100],LessEqual@@stc[#]&] (* Gus Wiseman, Apr 01 2020 *)
Formula
Conjecture: a(A000070(m) - k) = 2^m - A228354(k) for m > 0, 0 < k <= A000041(m). - Mikhail Kurkov, Oct 20 2023
A333219 Heinz number of the n-th composition in standard order.
1, 2, 3, 4, 5, 6, 6, 8, 7, 10, 9, 12, 10, 12, 12, 16, 11, 14, 15, 20, 15, 18, 18, 24, 14, 20, 18, 24, 20, 24, 24, 32, 13, 22, 21, 28, 25, 30, 30, 40, 21, 30, 27, 36, 30, 36, 36, 48, 22, 28, 30, 40, 30, 36, 36, 48, 28, 40, 36, 48, 40, 48, 48, 64, 17, 26, 33, 44
Offset: 1
Keywords
Comments
Includes all positive integers.
The k-th composition in standard order (row k of 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.
The Heinz number of a composition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
Examples
The sequence of terms together with their prime indices begins:
1: {} 15: {2,3} 25: {3,3}
2: {1} 20: {1,1,3} 30: {1,2,3}
3: {2} 15: {2,3} 30: {1,2,3}
4: {1,1} 18: {1,2,2} 40: {1,1,1,3}
5: {3} 18: {1,2,2} 21: {2,4}
6: {1,2} 24: {1,1,1,2} 30: {1,2,3}
6: {1,2} 14: {1,4} 27: {2,2,2}
8: {1,1,1} 20: {1,1,3} 36: {1,1,2,2}
7: {4} 18: {1,2,2} 30: {1,2,3}
10: {1,3} 24: {1,1,1,2} 36: {1,1,2,2}
9: {2,2} 20: {1,1,3} 36: {1,1,2,2}
12: {1,1,2} 24: {1,1,1,2} 48: {1,1,1,1,2}
10: {1,3} 24: {1,1,1,2} 22: {1,5}
12: {1,1,2} 32: {1,1,1,1,1} 28: {1,1,4}
12: {1,1,2} 13: {6} 30: {1,2,3}
16: {1,1,1,1} 22: {1,5} 40: {1,1,1,3}
11: {5} 21: {2,4} 30: {1,2,3}
14: {1,4} 28: {1,1,4} 36: {1,1,2,2}
Crossrefs
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Times@@Prime/@stc[n],{n,0,100}]
A345167 Numbers k such that the k-th composition in standard order is alternating.
0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 16, 17, 18, 20, 22, 24, 25, 32, 33, 34, 38, 40, 41, 44, 45, 48, 49, 50, 54, 64, 65, 66, 68, 70, 72, 76, 77, 80, 81, 82, 88, 89, 96, 97, 98, 102, 108, 109, 128, 129, 130, 132, 134, 140, 141, 144, 145, 148, 152, 153, 160, 161, 162
Offset: 1
Keywords
Comments
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.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
Examples
The terms together with their binary indices begin:
1: (1) 25: (1,3,1) 66: (5,2)
2: (2) 32: (6) 68: (4,3)
4: (3) 33: (5,1) 70: (4,1,2)
5: (2,1) 34: (4,2) 72: (3,4)
6: (1,2) 38: (3,1,2) 76: (3,1,3)
8: (4) 40: (2,4) 77: (3,1,2,1)
9: (3,1) 41: (2,3,1) 80: (2,5)
12: (1,3) 44: (2,1,3) 81: (2,4,1)
13: (1,2,1) 45: (2,1,2,1) 82: (2,3,2)
16: (5) 48: (1,5) 88: (2,1,4)
17: (4,1) 49: (1,4,1) 89: (2,1,3,1)
18: (3,2) 50: (1,3,2) 96: (1,6)
20: (2,3) 54: (1,2,1,2) 97: (1,5,1)
22: (2,1,2) 64: (7) 98: (1,4,2)
24: (1,4) 65: (6,1) 102: (1,3,1,2)
Links
- Wikipedia, Alternating permutation
Crossrefs
The complement is A345168.
Factorizations with a permutation of this type: A348379.
A003242 counts anti-run compositions.
A345164 counts alternating permutations of prime indices.
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Number of maximal anti-runs is A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Anti-runs are A333489.
- Non-alternating anti-runs are A345169.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse; wigQ[y_]:=Or[Length[y]==0,Length[Split[y]] ==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1]; Select[Range[0,100],wigQ@*stc]
A124766 Number of monotonically increasing runs for compositions in standard order.
0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 1, 2, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 3, 2, 3, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 1, 2, 2, 2, 1, 3, 2, 2, 1
Offset: 0
Comments
The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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. a(n) is the number of maximal weakly increasing runs in this composition. Alternatively, a(n) is one plus the number of strict descents in the same composition. For example, the weakly increasing runs of the 1234567th composition are ((3),(2),(1,2,2),(1,2,5),(1,1,1)), so a(1234567) = 5. The 4 strict descents together with the weak ascents are: 3 > 2 > 1 <= 2 <= 2 > 1 <= 2 <= 5 > 1 <= 1 <= 1. - Gus Wiseman, Apr 08 2020
Examples
Composition number 11 is 2,1,1; the increasing runs are 2; 1,1; so a(11) = 2. The table starts: 0 1 1 1 1 2 1 1 1 2 1 2 1 2 1 1 1 2 2 2 1 2 2 2 1 2 1 2 1 2 1 1 1 2 2 2 1 3 2 2 1 2 1 2 2 3 2 2 1 2 2 2 1 2 2 2 1 2 1 2 1 2 1 1
Crossrefs
Compositions of n with k strict descents are A238343.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766 (this sequence).
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Runs-resistance is A333628.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Length[Split[stc[n],#1<=#2&]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)
Formula
a(0) = 0, a(n) = A124761(n) + 1 for n > 0.
A333382 Number of adjacent unequal parts in the n-th composition in standard-order.
0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 0, 0, 1, 1, 1, 0, 2, 2, 1, 1, 2, 0, 1, 2, 3, 2, 1, 1, 2, 2, 2, 2, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 0, 0, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 3, 2, 1, 1, 2, 2, 2, 1, 1, 2
Offset: 0
Keywords
Comments
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.
For n > 0, a(n) is one fewer than the number of maximal runs of the n-th composition in standard-order.
Examples
The 46th composition in standard order is (2,1,1,2), with maximal runs ((2),(1,1),(2)), so a(46) = 3 - 1 = 2.
Links
- Wikipedia, Longest increasing subsequence
Crossrefs
Indices of first appearances (not counting 0) are A113835.
Partitions whose 0-appended first differences are a run are A007862.
Partitions whose first differences are a run are A049988.
A triangle counting maximal anti-runs of compositions is A106356.
A triangle counting maximal runs of compositions is A238279.
All of the following pertain to compositions in standard order (A066099):
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Strict compositions are ranked by A233564.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Anti-runs are ranked by A333489.
- Anti-runs are counted by A333381.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Length[Select[Partition[stc[n],2,1],UnsameQ@@#&]],{n,0,100}]
Formula
For n > 0, a(n) = A124767(n) - 1.
A333218 Numbers k such that the k-th composition in standard order is a permutation (of an initial interval).
0, 1, 5, 6, 37, 38, 41, 44, 50, 52, 549, 550, 553, 556, 562, 564, 581, 582, 593, 600, 610, 616, 649, 652, 657, 664, 708, 712, 786, 788, 802, 808, 836, 840, 16933, 16934, 16937, 16940, 16946, 16948, 16965, 16966, 16977, 16984, 16994, 17000, 17033, 17036, 17041
Offset: 1
Keywords
Comments
The k-th composition in standard order (row k of 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.
Examples
The sequence of terms together with their corresponding compositions begins:
0: () 593: (3,2,4,1) 16937: (5,4,2,3,1)
1: (1) 600: (3,2,1,4) 16940: (5,4,2,1,3)
5: (2,1) 610: (3,1,4,2) 16946: (5,4,1,3,2)
6: (1,2) 616: (3,1,2,4) 16948: (5,4,1,2,3)
37: (3,2,1) 649: (2,4,3,1) 16965: (5,3,4,2,1)
38: (3,1,2) 652: (2,4,1,3) 16966: (5,3,4,1,2)
41: (2,3,1) 657: (2,3,4,1) 16977: (5,3,2,4,1)
44: (2,1,3) 664: (2,3,1,4) 16984: (5,3,2,1,4)
50: (1,3,2) 708: (2,1,4,3) 16994: (5,3,1,4,2)
52: (1,2,3) 712: (2,1,3,4) 17000: (5,3,1,2,4)
549: (4,3,2,1) 786: (1,4,3,2) 17033: (5,2,4,3,1)
550: (4,3,1,2) 788: (1,4,2,3) 17036: (5,2,4,1,3)
553: (4,2,3,1) 802: (1,3,4,2) 17041: (5,2,3,4,1)
556: (4,2,1,3) 808: (1,3,2,4) 17048: (5,2,3,1,4)
562: (4,1,3,2) 836: (1,2,4,3) 17092: (5,2,1,4,3)
564: (4,1,2,3) 840: (1,2,3,4) 17096: (5,2,1,3,4)
581: (3,4,2,1) 16933: (5,4,3,2,1) 17170: (5,1,4,3,2)
582: (3,4,1,2) 16934: (5,4,3,1,2) 17172: (5,1,4,2,3)
Crossrefs
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Select[Range[0,1000],#==0||UnsameQ@@stc[#]&&Max@@stc[#]==Length[stc[#]]&]
A124768 Number of strictly increasing runs for compositions in standard order.
0, 1, 1, 2, 1, 2, 1, 3, 1, 2, 2, 3, 1, 2, 2, 4, 1, 2, 2, 3, 1, 3, 2, 4, 1, 2, 2, 3, 2, 3, 3, 5, 1, 2, 2, 3, 2, 3, 2, 4, 1, 2, 3, 4, 2, 3, 3, 5, 1, 2, 2, 3, 1, 3, 2, 4, 2, 3, 3, 4, 3, 4, 4, 6, 1, 2, 2, 3, 2, 3, 2, 4, 1, 3, 3, 4, 2, 3, 3, 5, 1, 2, 2, 3, 2, 4, 3, 5, 2, 3, 3, 4, 3, 4, 4, 6, 1, 2, 2, 3, 2, 3, 2, 4, 1
Offset: 0
Comments
The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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. a(n) is the number of maximal strictly increasing runs in this composition. Alternatively, a(n) is one plus the number of weak descents in the same composition. For example, the strictly increasing runs of the 1234567th composition are ((3),(2),(1,2),(2),(1,2,5),(1),(1),(1)), so a(1234567) = 8. The 7 weak descents together with the strict ascents are: 3 >= 2 >= 1 < 2 >= 2 >= 1 < 2 < 5 >= 1 >= 1 >= 1. - Gus Wiseman, Apr 08 2020
Examples
Composition number 11 is 2,1,1; the strictly increasing runs are 2; 1; 1; so a(11) = 3. The table starts: 0 1 1 2 1 2 1 3 1 2 2 3 1 2 2 4 1 2 2 3 1 3 2 4 1 2 2 3 2 3 3 5 1 2 2 3 2 3 2 4 1 2 3 4 2 3 3 5 1 2 2 3 1 3 2 4 2 3 3 4 3 4 4 6
Crossrefs
Compositions of n with k weak descents are A333213.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Partial sums from the right are A048793.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768 (this sequence).
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Heinz number is A333219.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are A333489.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Length[Split[stc[n],Less]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)
Formula
a(0) = 0, a(n) = A124763(n) + 1 for n > 0.
A333627 The a(n)-th composition in standard order is the sequence of run-lengths of the n-th composition in standard order.
0, 1, 1, 2, 1, 3, 3, 4, 1, 3, 2, 6, 3, 7, 5, 8, 1, 3, 3, 6, 3, 5, 7, 12, 3, 7, 6, 14, 5, 11, 9, 16, 1, 3, 3, 6, 2, 7, 7, 12, 3, 7, 4, 10, 7, 15, 13, 24, 3, 7, 7, 14, 7, 13, 15, 28, 5, 11, 10, 22, 9, 19, 17, 32, 1, 3, 3, 6, 3, 7, 7, 12, 3, 5, 6, 14, 7, 15, 13
Offset: 0
Keywords
Comments
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.
Examples
The standard compositions and their run-lengths:
0 ~ () -> () ~ 0
1 ~ (1) -> (1) ~ 1
2 ~ (2) -> (1) ~ 1
3 ~ (11) -> (2) ~ 2
4 ~ (3) -> (1) ~ 1
5 ~ (21) -> (11) ~ 3
6 ~ (12) -> (11) ~ 3
7 ~ (111) -> (3) ~ 4
8 ~ (4) -> (1) ~ 1
9 ~ (31) -> (11) ~ 3
10 ~ (22) -> (2) ~ 2
11 ~ (211) -> (12) ~ 6
12 ~ (13) -> (11) ~ 3
13 ~ (121) -> (111) ~ 7
14 ~ (112) -> (21) ~ 5
15 ~ (1111) -> (4) ~ 8
16 ~ (5) -> (1) ~ 1
17 ~ (41) -> (11) ~ 3
18 ~ (32) -> (11) ~ 3
19 ~ (311) -> (12) ~ 6
Links
- Claude Lenormand, Deux transformations sur les mots, Preprint, 5 pages, Nov 17 2003.
Crossrefs
Positions of first appearances are A333630.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Runs-resistance is A333628.
- First appearances of run-resistances are A333629.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Total[2^(Accumulate[Reverse[Length/@Split[stc[n]]]])]/2,{n,0,30}]
A124765 Number of monotonically decreasing runs for compositions in standard order.
0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3
Offset: 0
Comments
The standard order of compositions is given by A066099.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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. a(n) is the number of maximal weakly decreasing runs in this composition. Alternatively, a(n) is one plus the number of strict ascents in the same composition. For example, the weakly decreasing runs of the 1234567th composition are ((3,2,1),(2,2,1),(2),(5,1,1,1)), so a(1234567) = 4. The 3 strict ascents together with the weak descents are: 3 >= 2 >= 1 < 2 >= 2 >= 1 < 2 < 5 >= 1 >= 1 >= 1. - Gus Wiseman, Apr 08 2020
Examples
Composition number 11 is 2,1,1; the decreasing runs are 2,1,1; so a(11) = 1. The table starts: 0 1 1 1 1 1 2 1 1 1 1 1 2 2 2 1 1 1 1 1 2 1 2 1 2 2 2 2 2 2 2 1 1 1 1 1 1 1 2 1 2 2 1 1 2 2 2 1 2 2 2 2 3 2 3 2 2 2 2 2 2 2 2 1
Links
- Antti Karttunen, Table of n, a(n) for n = 0..16383
Crossrefs
Compositions of n with k strict ascents are A238343.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-runs are A333489.
- Runs-resistance is A333628.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Table[Length[Split[stc[n],GreaterEqual]],{n,0,100}] (* Gus Wiseman, Apr 08 2020 *)
Formula
a(0) = 0, a(n) = A124760(n) + 1 for n > 0.
Comments