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
A333219
Heinz number of the n-th composition in standard order.
Original entry on oeis.org
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
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}
The length of the k-th composition in standard order is
A000120(k).
The sum of the k-th composition in standard order is
A070939(k).
The maximum of the k-th composition in standard order is
A070939(k).
Cf.
A048793,
A056239,
A066099,
A112798,
A114994,
A124767,
A213925,
A225620,
A228351,
A233564,
A272919,
A333218.
-
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Table[Times@@Prime/@stc[n],{n,0,100}]
A333254
Lengths of maximal runs in the sequence of prime gaps (A001223).
Original entry on oeis.org
1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
The prime gaps split into the following runs: (1), (2,2), (4), (2), (4), (2), (4), (6), (2), (6), (4), (2), (4), (6,6), (2), (6), (4), ...
The weakly decreasing version is
A333212.
The weakly increasing version is
A333215.
The strictly decreasing version is
A333252.
The strictly increasing version is
A333253.
Positions of first appearances are
A335406.
The first term of the first length-n arithmetic progression of consecutive primes is
A006560(n), with index
A089180(n).
Positions of adjacent equal prime gaps are
A064113.
Positions of adjacent unequal prime gaps are
A333214.
-
p:= 3: t:= 1: R:= NULL: s:= 1: count:= 0:
for i from 2 while count < 100 do
q:= nextprime(p);
g:= q-p; p:= q;
if g = t then s:= s+1
else count:= count+1; R:= R, s; t:= g; s:= 1;
fi
od:
R; # Robert Israel, Jan 06 2021
-
Length/@Split[Differences[Array[Prime,100]],#1==#2&]//Most
A345167
Numbers k such that the k-th composition in standard order is alternating.
Original entry on oeis.org
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
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)
Partitions with a permutation of this type:
A345170, complement
A345165.
Factorizations with a permutation of this type:
A348379.
A003242 counts anti-run compositions.
A345164 counts alternating permutations of prime indices.
Statistics of standard compositions:
- Number of maximal anti-runs is
A333381.
- Number of distinct parts is
A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are
A114994.
- Weakly increasing compositions (multisets) are
A225620.
- Non-alternating anti-runs are
A345169.
Cf.
A025048,
A025049,
A059893,
A106356,
A238279,
A335448,
A344604,
A344615,
A344653,
A344742,
A345163,
A348377.
-
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]
A374249
Numbers k such that the k-th composition in standard order has its equal parts contiguous.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 50, 52, 56, 58, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 78, 79, 80, 81, 83, 84, 85
Offset: 1
The terms together with their standard 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)
11: (2,1,1)
12: (1,3)
14: (1,1,2)
15: (1,1,1,1)
16: (5)
See A374253 for the complement: 13, 22, 25, 27, 29, ...
Compositions of this type are counted by
A274174.
Permutations of prime indices of this type are counted by
A333175.
A066099 lists compositions in standard order.
A333755 counts compositions by number of runs.
A335454 counts patterns matched by standard compositions.
A335462 counts (1,2,1)- and (2,1,2)-matching permutations of prime indices.
Cf.
A106356,
A124762,
A238130,
A238279,
A261982,
A272919,
A333382,
A335450,
A335460,
A335524,
A335525.
-
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Select[Range[0,100],UnsameQ@@First/@Split[stc[#]]&]
A124766
Number of monotonically increasing runs for compositions in standard order.
Original entry on oeis.org
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
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
Compositions of n with k strict descents are
A238343.
All of the following pertain to compositions in standard order (
A066099):
- 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.
- Constant compositions are
A272919.
- Strictly decreasing compositions are
A333255.
- Strictly increasing compositions are
A333256.
-
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 *)
A333382
Number of adjacent unequal parts in the n-th composition in standard-order.
Original entry on oeis.org
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
The 46th composition in standard order is (2,1,1,2), with maximal runs ((2),(1,1),(2)), so a(46) = 3 - 1 = 2.
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 counted by
A333381.
Cf.
A000005,
A000120,
A003242,
A029931,
A048793,
A059893,
A070939,
A114994,
A225620,
A228351,
A238424.
-
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}]
A275692
Numbers k such that every rotation of the binary digits of k is less than k.
Original entry on oeis.org
0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 194, 196, 200, 202, 208, 210, 212, 216, 218, 224, 226, 228
Offset: 1
6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
1: 1 ~ {1}
2: 10 ~ {2}
4: 100 ~ {3}
6: 110 ~ {2,3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
16: 10000 ~ {5}
20: 10100 ~ {3,5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
32: 100000 ~ {6}
40: 101000 ~ {4,6}
48: 110000 ~ {5,6}
50: 110010 ~ {2,5,6}
52: 110100 ~ {3,5,6}
56: 111000 ~ {4,5,6}
58: 111010 ~ {2,4,5,6}
(End)
Numbers whose binary expansion is aperiodic are
A328594.
Numbers whose reversed binary expansion is a necklace are
A328595.
Length of Lyndon factorization of binary expansion is
A211100.
Length of co-Lyndon factorization of binary expansion is
A329312.
Length of Lyndon factorization of reversed binary expansion is
A329313.
Length of co-Lyndon factorization of reversed binary expansion is
A329326.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Lyndon compositions are
A275692 (this sequence).
- Co-Lyndon compositions are
A326774.
- Co-Lyndon factorizations are counted by
A333765.
- Lyndon factorizations are counted by
A333940.
-
filter:= proc(n) local L, k;
L:= convert(convert(n,binary),string);
for k from 1 to length(L)-1 do
if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
od;
true
end proc:
select(filter, [$0..1000]);
-
filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
Select[Range[0, 1000], filterQ] (* Jean-François Alcover, Apr 29 2019 *)
-
def ok(n):
b = bin(n)[2:]
return all(b[i:] + b[:i] < b for i in range(1, len(b)))
print([k for k in range(230) if ok(k)]) # Michael S. Branicky, May 26 2022
A124768
Number of strictly increasing runs for compositions in standard order.
Original entry on oeis.org
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
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
Compositions of n with k weak descents are
A333213.
All of the following pertain to compositions in standard order (
A066099):
- Partial sums from the right are
A048793.
- 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.
- Constant compositions are
A272919.
- Strictly decreasing compositions are
A333255.
- Strictly increasing compositions are
A333256.
-
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 *)
Comments