A088218
Total number of leaves in all rooted ordered trees with n edges.
Original entry on oeis.org
1, 1, 3, 10, 35, 126, 462, 1716, 6435, 24310, 92378, 352716, 1352078, 5200300, 20058300, 77558760, 300540195, 1166803110, 4537567650, 17672631900, 68923264410, 269128937220, 1052049481860, 4116715363800, 16123801841550, 63205303218876, 247959266474052
Offset: 0
G.f. = 1 + x + 3*x^2 + 10*x^3 + 35*x^4 + 126*x^5 + 462*x^6 + 1716*x^7 + ...
The five rooted ordered trees with 3 edges have 10 leaves.
..x........................
..o..x.x..x......x.........
..o...o...o.x..x.o..x.x.x..
..r...r....r....r.....r....
- L. W. Shapiro and C. J. Wang, Generating identities via 2 X 2 matrices, Congressus Numerantium, 205 (2010), 33-46.
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
- Anwar Al Ghabra, K. Gopala Krishna, Patrick Labelle, and Vasilisa Shramchenko, Enumeration of multi-rooted plane trees, arXiv:2301.09765 [math.CO], 2023.
- Paul Barry, On Integer-Sequence-Based Constructions of Generalized Pascal Triangles, Journal of Integer Sequences, Vol. 9 (2006), Article 06.2.4.
- B. Dasarathy and C. Yang, A transformation on ordered trees, Comput. J. 23 (1980) 161-164. - _Nachum Dershowitz_, Sep 01 2016
- Toufik Mansour and Mark Shattuck, A statistic on n-color compositions and related sequences, Proc. Indian Acad. Sci. (Math. Sci.) Vol. 124, No. 2, May 2014, pp. 127-140.
- Anthony Mansuy, Preordered forests, packed words and contraction algebras, J. Algebra 411 (2014) 259-311.
- Mircea Merca, A Note on Cosine Power Sums, J. Integer Sequences, Vol. 15 (2012), Article 12.5.3.
- A. Vogt, Resummation of small-x double logarithms in QCD: semi-inclusive electron-positron annihilation, arXiv preprint arXiv:1108.2993 [hep-ph], 2011.
Same as
A001700 modulo initial term and offset.
A000041 counts partitions of 2n with alternating sum 0, ranked by
A000290.
A003242 counts anti-run compositions.
A103919 counts partitions by sum and alternating sum (reverse:
A344612).
A106356 counts compositions by number of maximal anti-runs.
A124754 gives the alternating sum of standard compositions.
A345197 counts compositions by sum, length, and alternating sum.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
Cf.
A000027,
A000070,
A000097,
A000108,
A001622,
A006232,
A008965,
A039599,
A045992,
A058696,
A094527,
A097070,
A110162,
A110555,
A180662,
A238279,
A239830,
A325534,
A325535,
A333213,
A344607,
A344611,
A344617.
-
[Binomial(2*n-1, n): n in [0..30]]; // Vincenzo Librandi, Aug 07 2014
-
seq(binomial(2*n-1, n),n=0..24); # Peter Luschny, Sep 22 2014
-
a[ n_] := SeriesCoefficient[(1 - x)^-n, {x, 0, n}];
c = (1 - (1 - 4 x)^(1/2))/(2 x);CoefficientList[Series[1/(1-(c-1)),{x,0,20}],x] (* Geoffrey Critzer, Dec 02 2010 *)
Table[Binomial[2 n - 1, n], {n, 0, 20}] (* Vincenzo Librandi, Aug 07 2014 *)
a[ n_] := If[ n < 0, 0, With[ {m = 2 n}, m! SeriesCoefficient[ (1 + BesselI[0, 2 x]) / 2, {x, 0, m}]]]; (* Michael Somos, Nov 22 2014 *)
-
{a(n) = sum( i=0, n, binomial(n+i-2,i))};
-
{a(n) = if( n<0, 0, polcoeff( (1 + 1 / sqrt(1 - 4*x + x * O(x^n))) / 2, n))};
-
{a(n) = if( n<0, 0, polcoeff( 1 / (1 - x + x * O(x^n))^n, n))};
-
{a(n) = if( n<0, 0, binomial( 2*n - 1, n))};
-
{a(n) = if( n<1, n==0, polcoeff( subst((1 - x) / (1 - 2*x), x, serreverse( x - x^2 + x * O(x^n))), n))};
-
def A088218(n):
return rising_factorial(n,n)/falling_factorial(n,n)
[A088218(n) for n in (0..24)] # Peter Luschny, Nov 21 2012
A025047
Number of alternating compositions, i.e., compositions with alternating increases and decreases, starting with either an increase or a decrease.
Original entry on oeis.org
1, 1, 1, 3, 4, 7, 12, 19, 29, 48, 75, 118, 186, 293, 460, 725, 1139, 1789, 2814, 4422, 6949, 10924, 17168, 26979, 42404, 66644, 104737, 164610, 258707, 406588, 639009, 1004287, 1578363, 2480606, 3898599, 6127152, 9629623, 15134213, 23785388, 37381849, 58750468
Offset: 0
From _Joerg Arndt_, Dec 28 2012: (Start)
There are a(7)=19 such compositions of 7:
[ 1] + [ 1 2 1 2 1 ]
[ 2] + [ 1 2 1 3 ]
[ 3] + [ 1 3 1 2 ]
[ 4] + [ 1 4 2 ]
[ 5] + [ 1 5 1 ]
[ 6] + [ 1 6 ]
[ 7] - [ 2 1 3 1 ]
[ 8] - [ 2 1 4 ]
[ 9] + [ 2 3 2 ]
[10] + [ 2 4 1 ]
[11] + [ 2 5 ]
[12] - [ 3 1 2 1 ]
[13] - [ 3 1 3 ]
[14] + [ 3 4 ]
[15] - [ 4 1 2 ]
[16] - [ 4 3 ]
[17] - [ 5 2 ]
[18] - [ 6 1 ]
[19] 0 [ 7 ]
For A025048(7)-1=10 of these the first two parts are increasing (marked by '+'),
and for A025049(7)-1=8 the first two parts are decreasing (marked by '-').
The composition into one part is counted by both A025048 and A025049.
(End)
The version allowing pairs (x,x) is
A344604.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A274174 counts compositions with equal parts contiguous.
A345164 counts alternating permutations of prime indices.
A345165 counts partitions w/o alternating permutation, ranked by
A345171.
A345170 counts partitions w/ alternating permutation, ranked by
A345172.
Cf.
A000070,
A008965,
A238279,
A333755,
A344606,
A344614,
A344653,
A344740,
A345163,
A345166,
A345169.
-
b:= proc(n, l, t) option remember; `if`(n=0, 1, add(
b(n-j, j, 1-t), j=`if`(t=1, 1..min(l-1, n), l+1..n)))
end:
a:= n-> 1+add(add(b(n-j, j, i), i=0..1), j=1..n-1):
seq(a(n), n=0..40); # Alois P. Heinz, Jan 31 2024
-
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],wigQ]],{n,0,15}] (* Gus Wiseman, Jun 17 2021 *)
-
D(n,f)={my(M=matrix(n,n,j,k,k>=j), s=M[,n]); for(b=1, n, f=!f; M=matrix(n,n,j,k,if(k1, M[j-k,k-1]), M[j-k,n]-M[j-k,k] ))); for(k=2, n, M[,k]+=M[,k-1]); s+=M[,n]); s~}
seq(n) = concat([1], D(n,0) + D(n,1) - vector(n,j,1)) \\ Andrew Howroyd, Jan 31 2024
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]
A345192
Number of non-alternating compositions of n.
Original entry on oeis.org
0, 0, 1, 1, 4, 9, 20, 45, 99, 208, 437, 906, 1862, 3803, 7732, 15659, 31629, 63747, 128258, 257722, 517339, 1037652, 2079984, 4167325, 8346204, 16710572, 33449695, 66944254, 133959021, 268028868, 536231903, 1072737537, 2145905285, 4292486690, 8586035993, 17173742032, 34350108745, 68704342523, 137415168084
Offset: 0
The a(2) = 1 through a(6) = 20 compositions:
(11) (111) (22) (113) (33)
(112) (122) (114)
(211) (221) (123)
(1111) (311) (222)
(1112) (321)
(1121) (411)
(1211) (1113)
(2111) (1122)
(11111) (1131)
(1221)
(1311)
(2112)
(2211)
(3111)
(11112)
(11121)
(11211)
(12111)
(21111)
(111111)
The version for factorizations is
A348613.
A003242 counts anti-run compositions.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A274174 counts compositions with equal parts contiguous.
A344604 counts alternating compositions with twins.
A344605 counts alternating patterns with twins.
A344654 counts non-twin partitions with no alternating permutation.
A345162 counts normal partitions with no alternating permutation.
A345164 counts alternating permutations of prime indices.
A345170 counts partitions w/ alternating permutation, ranked by
A345172.
A345165 counts partitions w/o alternating permutation, ranked by
A345171.
Patterns:
-
A128761 avoiding (1,2,3) adjacent.
-
A344614 avoiding (1,2,3) and (3,2,1) adjacent.
-
A344615 weakly avoiding (1,2,3) adjacent.
Cf.
A000070,
A008965,
A178470,
A238279,
A333755,
A335126,
A344606,
A344653,
A344740,
A345163,
A345166,
A345169,
A345173,
A348380.
-
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!wigQ[#]&]],{n,0,15}]
A345170
Number of integer partitions of n with an alternating permutation.
Original entry on oeis.org
1, 1, 1, 2, 3, 5, 6, 10, 14, 19, 25, 36, 48, 64, 84, 111, 146, 191, 244, 315, 404, 515, 651, 823, 1035, 1295, 1616, 2011, 2492, 3076, 3787, 4650, 5695, 6952, 8463, 10280, 12460, 15059, 18162, 21858, 26254, 31463, 37641, 44933, 53554, 63704, 75653, 89683, 106162, 125445, 148020
Offset: 0
The a(1) = 1 through a(8) = 14 partitions:
(1) (2) (3) (4) (5) (6) (7) (8)
(21) (31) (32) (42) (43) (53)
(211) (41) (51) (52) (62)
(221) (321) (61) (71)
(311) (411) (322) (332)
(2211) (331) (422)
(421) (431)
(511) (521)
(3211) (611)
(22111) (3221)
(3311)
(4211)
(22211)
(32111)
Includes all strict partitions
A000009.
Including twins (x,x) gives
A344740.
The Heinz numbers of these partitions are
A345172.
The version for factorizations is
A348379.
A001250 counts alternating permutations.
A003242 counts anti-run compositions.
A344604 counts alternating compositions with twins.
Cf.
A000070,
A103919,
A335126,
A344605,
A344653,
A344654,
A344742,
A345164,
A345166,
A345167,
A345168,
A345195.
-
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[IntegerPartitions[n],Select[Permutations[#],wigQ]!={}&]],{n,0,15}]
A025048
Number of up/down (initially ascending) compositions of n.
Original entry on oeis.org
1, 1, 1, 2, 3, 4, 7, 11, 16, 26, 41, 64, 100, 158, 247, 389, 612, 960, 1509, 2372, 3727, 5858, 9207, 14468, 22738, 35737, 56164, 88268, 138726, 218024, 342652, 538524, 846358, 1330160, 2090522, 3285526, 5163632, 8115323, 12754288, 20045027, 31503382
Offset: 0
From _Gus Wiseman_, Jan 15 2022: (Start)
The a(1) = 1 through a(7) = 11 up/down compositions:
(1) (2) (3) (4) (5) (6) (7)
(1,2) (1,3) (1,4) (1,5) (1,6)
(1,2,1) (2,3) (2,4) (2,5)
(1,3,1) (1,3,2) (3,4)
(1,4,1) (1,4,2)
(2,3,1) (1,5,1)
(1,2,1,2) (2,3,2)
(2,4,1)
(1,2,1,3)
(1,3,1,2)
(1,2,1,2,1)
(End)
The case of permutations is
A000111.
The version for patterns is
A350354.
These compositions are ranked by
A350355.
A344654
Number of integer partitions of n of which every permutation has a consecutive monotone triple, i.e., a triple (..., x, y, z, ...) such that either x <= y <= z or x >= y >= z.
Original entry on oeis.org
0, 0, 0, 1, 1, 2, 4, 5, 7, 11, 16, 20, 28, 37, 50, 65, 84, 106, 140, 175, 222, 277, 350, 432, 539, 663, 819, 999, 1225, 1489, 1816, 2192, 2653, 3191, 3846, 4603, 5516, 6578, 7852, 9327, 11083, 13120, 15532, 18328, 21620, 25430, 29904, 35071, 41110, 48080
Offset: 0
The a(3) = 1 through a(9) = 11 partitions:
(111) (1111) (2111) (222) (2221) (2222) (333)
(11111) (3111) (4111) (5111) (3222)
(21111) (31111) (41111) (6111)
(111111) (211111) (221111) (22221)
(1111111) (311111) (51111)
(2111111) (321111)
(11111111) (411111)
(2211111)
(3111111)
(21111111)
(111111111)
The Heinz numbers of these partitions are
A344653, complement
A344742.
The complement is counted by
A344740.
The normal case starts 0, 0, 0, then becomes
A345162, complement
A345163.
A001250 counts wiggly permutations.
A003242 counts anti-run compositions.
A344604 counts wiggly compositions with twins.
A344605 counts wiggly patterns with twins.
A344606 counts wiggly permutations of prime indices with twins.
A344614 counts compositions with no consecutive strictly monotone triple.
A345164 counts wiggly permutations of prime indices.
A345170 counts partitions with a wiggly permutation, ranked by
A345172.
A345192 counts non-wiggly compositions.
Cf.
A000041,
A000070,
A102726,
A103919,
A333489,
A335126,
A344607,
A344615,
A345166,
A345168,
A345169.
-
Table[Length[Select[IntegerPartitions[n],Select[Permutations[#],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]=={}&]],{n,15}]
A344653
Every permutation of the prime factors of n has a consecutive monotone triple, i.e., a triple (..., x, y, z, ...) such that either x <= y <= z or x >= y >= z.
Original entry on oeis.org
8, 16, 24, 27, 32, 40, 48, 54, 56, 64, 80, 81, 88, 96, 104, 112, 125, 128, 135, 136, 144, 152, 160, 162, 176, 184, 189, 192, 208, 224, 232, 240, 243, 248, 250, 256, 270, 272, 288, 296, 297, 304, 320, 324, 328, 336, 343, 344, 351, 352, 368, 375, 376, 378, 384
Offset: 1
The sequence of terms together with their prime indices begins:
8: {1,1,1}
16: {1,1,1,1}
24: {1,1,1,2}
27: {2,2,2}
32: {1,1,1,1,1}
40: {1,1,1,3}
48: {1,1,1,1,2}
54: {1,2,2,2}
56: {1,1,1,4}
64: {1,1,1,1,1,1}
80: {1,1,1,1,3}
81: {2,2,2,2}
88: {1,1,1,5}
96: {1,1,1,1,1,2}
For example, 36 has prime indices (1,1,2,2), which has the two wiggly permutations (1,2,1,2) and (2,1,2,1), so 36 is not in the sequence.
These partitions are counted by
A344654.
A000041 counts partitions of 2n with alternating sum 0, ranked by
A000290.
A001250 counts wiggly permutations.
A003242 counts anti-run compositions.
A344604 counts wiggly compositions with twins.
A345164 counts wiggly permutations of prime indices.
A345165 counts partitions without a wiggly permutation, ranked by
A345171.
A345170 counts partitions with a wiggly permutation, ranked by
A345172.
A345192 counts non-wiggly compositions.
Cf.
A001222,
A071321,
A071322,
A316523,
A316524,
A335126,
A344614,
A344615,
A344616,
A344652,
A345163,
A345168,
A345193.
-
Select[Range[100],Select[Permutations[Flatten[ConstantArray@@@FactorInteger[#]]],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]=={}&]
A344604
Number of alternating compositions of n, including twins (x,x).
Original entry on oeis.org
1, 1, 2, 3, 5, 7, 13, 19, 30, 48, 76, 118, 187, 293, 461, 725, 1140, 1789, 2815, 4422, 6950, 10924, 17169, 26979, 42405, 66644, 104738, 164610, 258708, 406588, 639010, 1004287, 1578364, 2480606, 3898600, 6127152, 9629624, 15134213, 23785389, 37381849, 58750469
Offset: 0
The a(1) = 1 through a(7) = 19 compositions:
(1) (2) (3) (4) (5) (6) (7)
(11) (12) (13) (14) (15) (16)
(21) (22) (23) (24) (25)
(31) (32) (33) (34)
(121) (41) (42) (43)
(131) (51) (52)
(212) (132) (61)
(141) (142)
(213) (151)
(231) (214)
(312) (232)
(1212) (241)
(2121) (313)
(412)
(1213)
(1312)
(2131)
(3121)
(12121)
A001250 counts alternating permutations.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A325534 counts separable partitions.
A325535 counts inseparable partitions.
A344605 counts alternating patterns including twins.
A344606 counts alternating permutations of prime factors including twins.
Counting compositions by patterns:
-
A106351 avoiding (1,1) adjacent by sum and length.
-
A128695 avoiding (1,1,1) adjacent.
-
A128761 avoiding (1,2,3) adjacent.
-
A344614 avoiding (1,2,3) and (3,2,1) adjacent.
-
A344615 weakly avoiding (1,2,3) adjacent.
Cf.
A000041,
A006330,
A008965,
A238279,
A239830,
A333213,
A238279/
A333755,
A344612,
A344616,
A344617,
A344618.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]],{n,0,15}]
A345165
Number of integer partitions of n without an alternating permutation.
Original entry on oeis.org
0, 0, 1, 1, 2, 2, 5, 5, 8, 11, 17, 20, 29, 37, 51, 65, 85, 106, 141, 175, 223, 277, 351, 432, 540, 663, 820, 999, 1226, 1489, 1817, 2192, 2654, 3191, 3847, 4603, 5517, 6578, 7853, 9327, 11084, 13120, 15533, 18328, 21621, 25430, 29905, 35071, 41111, 48080, 56206, 65554, 76420, 88918
Offset: 0
The a(2) = 1 through a(9) = 11 partitions:
(11) (111) (22) (2111) (33) (2221) (44) (333)
(1111) (11111) (222) (4111) (2222) (3222)
(3111) (31111) (5111) (6111)
(21111) (211111) (41111) (22221)
(111111) (1111111) (221111) (51111)
(311111) (321111)
(2111111) (411111)
(11111111) (2211111)
(3111111)
(21111111)
(111111111)
The Heinz numbers of these partitions are
A345171.
A003242 counts anti-run compositions.
A025047 counts alternating or wiggly compositions.
A344604 counts alternating compositions with twins.
A345164 counts alternating permutations of prime indices, w/ twins
A344606.
Cf.
A000070,
A025048,
A025049,
A103919,
A335126,
A344605,
A344607,
A344615,
A344653,
A345166,
A345167,
A345168,
A345169,
A347706,
A348609.
-
wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[IntegerPartitions[n],Select[Permutations[#],wigQ]=={}&]],{n,0,15}]
Showing 1-10 of 54 results.
Comments