A003242
Number of compositions of n such that no two adjacent parts are equal (these are sometimes called Carlitz compositions).
Original entry on oeis.org
1, 1, 1, 3, 4, 7, 14, 23, 39, 71, 124, 214, 378, 661, 1152, 2024, 3542, 6189, 10843, 18978, 33202, 58130, 101742, 178045, 311648, 545470, 954658, 1670919, 2924536, 5118559, 8958772, 15680073, 27443763, 48033284, 84069952, 147142465, 257534928, 450748483, 788918212
Offset: 0
From _Joerg Arndt_, Oct 27 2012: (Start)
The 23 such compositions of n=7 are
[ 1] 1 2 1 2 1
[ 2] 1 2 1 3
[ 3] 1 2 3 1
[ 4] 1 2 4
[ 5] 1 3 1 2
[ 6] 1 3 2 1
[ 7] 1 4 2
[ 8] 1 5 1
[ 9] 1 6
[10] 2 1 3 1
[11] 2 1 4
[12] 2 3 2
[13] 2 4 1
[14] 2 5
[15] 3 1 2 1
[16] 3 1 3
[17] 3 4
[18] 4 1 2
[19] 4 2 1
[20] 4 3
[21] 5 2
[22] 6 1
[23] 7
(End)
- Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 191.
- Alois P. Heinz, Table of n, a(n) for n = 0..4100 (first 501 terms from Christian G. Bower)
- L. Carlitz, Restricted Compositions, Fibonacci Quarterly, 14 (1976) 254-264.
- Sylvie Corteel, Paweł Hitczenko, Generalizations of Carlitz Compositions, Journal of Integer Sequences, Vol. 10 (2007), Article 07.8.8
- Steven R. Finch, Errata and Addenda to Mathematical Constants, arXiv:2001.00578 [math.HO], 2020-2022, p. 42 and 117.
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 201
- F. Harary & R. W. Robinson, The number of achiral trees, Jnl. Reine Angewandte Mathematik 278 (1975), 322-335. (Annotated scanned copy)
- A. Knopfmacher and H. Prodinger, On Carlitz compositions, European Journal of Combinatorics, Vol. 19, 1998, pp. 579-589.
- E. Munarini, M. Poneti, S. Rinaldi, Matrix compositions, JIS 12 (2009) 09.4.8, Chapter 8.
Compositions with adjacent parts coprime are
A167606.
The complement is counted by
A261983.
-
a003242 n = a003242_list !! n
a003242_list = 1 : f [1] where
f xs = y : f (y : xs) where
y = sum $ zipWith (*) xs a048272_list
-- Reinhard Zumkeller, Nov 04 2015
-
b:= proc(n, i) option remember; `if`(n=0, 1,
add(`if`(j=i, 0, b(n-j, `if`(j<=n-j, j, 0))), j=1..n))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..50); # Alois P. Heinz, Mar 27 2014
-
A048272[n_] := Total[If[OddQ[#], 1, -1]& /@ Divisors[n]]; a[n_] := a[n] = Sum[A048272[k]*a[n-k], {k, 1, n}]; a[0] = 1; Table[a[n], {n, 0, 38}](* Jean-François Alcover, Nov 25 2011, after Vladeta Jovovic *)
nmax = 50; CoefficientList[Series[1/(1 - Sum[x^k/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] (* Vaclav Kotesovec, Jul 07 2020 *)
Table[Count[Flatten[Permutations/@IntegerPartitions[n],1],?(FreeQ[Differences[#],0]&)],{n,0,20}] (* The program generates the first 21 terms of the sequence. *) (* _Harvey P. Dale, Nov 23 2024 *)
-
N = 66; x = 'x + O('x^N); p=2;
gf = 1/(1-sum(k=1,N, x^k/(1-x^k)-p*x^(k*p)/(1-x^(k*p))));
Vec(gf) /* Joerg Arndt, Apr 28 2013 */
A239455
Number of Look-and-Say partitions of n; see Comments.
Original entry on oeis.org
0, 1, 2, 2, 4, 5, 7, 10, 13, 16, 21, 28, 33, 45, 55, 65, 83, 105, 121, 155, 180, 217, 259, 318, 362, 445, 512, 614, 707, 850, 958, 1155, 1309, 1543, 1754, 2079, 2327, 2740, 3085, 3592, 4042, 4699, 5253, 6093, 6815, 7839, 8751, 10069, 11208, 12832, 14266, 16270
Offset: 0
The 11 partitions of 6 generate 7 Look-and-Say partitions as follows:
6 -> 111111
51 -> 111111
42 -> 111111
411 -> 21111
33 -> 222
321 -> 111111
3111 -> 3111
222 -> 33
2211 -> 222
21111 -> 411
111111 -> 6,
so that a(6) counts these 7 partitions: 111111, 21111, 222, 3111, 33, 411, 6.
These include all Wilf partitions, counted by
A098859, ranked by
A130091.
These partitions are listed by
A239454 in graded reverse-lex order.
The non-Wilf case is counted by
A351592.
A181819 = Heinz number of the prime signature of n (prime shadow).
A279790 counts disjoint families on strongly normal multisets.
A329738 = compositions with all equal run-lengths.
Counting words with all distinct run-lengths:
Cf.
A000041,
A008284,
A047966,
A182857,
A225485,
A297770,
A304660,
A305563,
A329746,
A351201,
A351202,
A351291.
-
LS[part_List] := Reverse[Sort[Flatten[Map[Table[#[[2]], {#[[1]]}] &, Tally[part]]]]]; LS[n_Integer] := #[[Reverse[Ordering[PadRight[#]]]]] &[DeleteDuplicates[Map[LS, IntegerPartitions[n]]]]; TableForm[t = Map[LS[#] &, Range[10]]](*A239454,array*)
Flatten[t](*A239454,sequence*)
Map[Length[LS[#]] &, Range[25]](*A239455*)
(* Peter J. C. Moses, Mar 18 2014 *)
disjointFamilies[y_]:=Select[Tuples[IntegerPartitions/@Length/@Split[y]],UnsameQ@@Join@@#&];
Table[Length[Select[IntegerPartitions[n],Length[disjointFamilies[#]]>0&]],{n,0,10}] (* Gus Wiseman, Aug 11 2025 *)
A351293
Number of non-Look-and-Say partitions of n. Number of integer partitions of n such that there is no way to choose a disjoint strict integer partition of each multiplicity.
Original entry on oeis.org
0, 0, 0, 1, 1, 2, 4, 5, 9, 14, 21, 28, 44, 56, 80, 111, 148, 192, 264, 335, 447, 575, 743, 937, 1213, 1513, 1924, 2396, 3011, 3715, 4646, 5687, 7040, 8600, 10556, 12804, 15650, 18897, 22930, 27593, 33296, 39884, 47921, 57168, 68360, 81295, 96807, 114685
Offset: 0
The a(3) = 1 through a(9) = 14 partitions:
(21) (31) (32) (42) (43) (53) (54)
(41) (51) (52) (62) (63)
(321) (61) (71) (72)
(2211) (421) (431) (81)
(3211) (521) (432)
(3221) (531)
(3311) (621)
(4211) (3321)
(32111) (4221)
(4311)
(5211)
(32211)
(42111)
(321111)
These are all non-Wilf partitions (counted by
A336866, ranked by
A130092).
These partitions appear to be ranked by
A351295.
Non-Wilf partitions in the complement are counted by
A351592.
A032020 = number of binary expansions with all distinct run-lengths.
A044813 = numbers whose binary expansion has all distinct run-lengths.
A098859 = Wilf partitions (distinct multiplicities), ranked by
A130091.
A181819 = Heinz number of the prime signature of n (prime shadow).
A329738 = compositions with all equal run-lengths.
A329739 = compositions with all distinct run-lengths, for all runs
A351013.
A351017 = binary words with all distinct run-lengths, for all runs
A351016.
A351292 = patterns with all distinct run-lengths, for all runs
A351200.
Cf.
A000041,
A008284,
A047966,
A182857,
A225485,
A238130,
A297770,
A304660,
A305563,
A329740,
A329746,
A351202,
A351291.
-
disjointFamilies[y_]:=Select[Tuples[IntegerPartitions/@Length/@Split[y]],UnsameQ@@Join@@#&];
Table[Length[Select[IntegerPartitions[n],Length[disjointFamilies[#]]==0&]],{n,0,15}] (* Gus Wiseman, Aug 13 2025 *)
A329739
Number of compositions of n whose run-lengths are all different.
Original entry on oeis.org
1, 1, 2, 2, 5, 8, 10, 20, 28, 41, 62, 102, 124, 208, 278, 426, 571, 872, 1158, 1718, 2306, 3304, 4402, 6286, 8446, 11725, 15644, 21642, 28636, 38956, 52296, 70106, 93224, 124758, 165266, 218916, 290583, 381706, 503174, 659160, 865020, 1124458, 1473912, 1907298
Offset: 0
The a(1) = 1 through a(7) = 20 compositions:
(1) (2) (3) (4) (5) (6) (7)
(11) (111) (22) (113) (33) (115)
(112) (122) (114) (133)
(211) (221) (222) (223)
(1111) (311) (411) (322)
(1112) (1113) (331)
(2111) (3111) (511)
(11111) (11112) (1114)
(21111) (1222)
(111111) (2221)
(4111)
(11113)
(11122)
(22111)
(31111)
(111112)
(111211)
(112111)
(211111)
(1111111)
Compositions with relatively prime run-lengths are
A000740.
Compositions with distinct multiplicities are
A242882.
Compositions with distinct differences are
A325545.
Compositions with equal run-lengths are
A329738.
Compositions with normal run-lengths are
A329766.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Length/@Split[#]&]],{n,0,10}]
A304442
Number of partitions of n in which the sequence of the sum of the same summands is constant.
Original entry on oeis.org
1, 1, 2, 2, 4, 2, 5, 2, 7, 3, 5, 2, 13, 2, 5, 4, 11, 2, 13, 2, 12, 4, 5, 2, 28, 3, 5, 5, 12, 2, 18, 2, 17, 4, 5, 4, 44, 2, 5, 4, 24, 2, 18, 2, 12, 10, 5, 2, 63, 3, 9, 4, 12, 2, 34, 4, 24, 4, 5, 2, 67, 2, 5, 10, 27, 4, 18, 2, 12, 4, 14, 2, 120, 2, 5, 7, 12, 4, 18, 2, 54
Offset: 0
a(72) = binomial(d(72),1) + binomial(d(36),2) + binomial(d(24),3) + binomial(d(18),4) + binomial(d(12),6) = 12 + 36 + 56 + 15 + 1 = 120, where d(n) is the number of divisors of n.
--+----------------------+-----------------------------------------
n | | Sequence of the sum of the same summands
--+----------------------+-----------------------------------------
1 | 1 | 1
2 | 2 | 2
| 1+1 | 2
3 | 3 | 3
| 1+1+1 | 3
4 | 4 | 4
| 2+2 | 4
| 2+1+1 | 2, 2
| 1+1+1+1 | 4
5 | 5 | 5
| 1+1+1+1+1 | 5
6 | 6 | 6
| 3+3 | 6
| 3+1+1+1 | 3, 3
| 2+2+2 | 6
| 1+1+1+1+1+1 | 6
For run-lengths instead of run-sums we have
A047966, compositions
A329738.
These partitions are ranked by
A353833.
-
Table[Length[Select[IntegerPartitions[n],SameQ@@Total/@Split[#]&]],{n,0,15}] (* Gus Wiseman, Jun 25 2022 *)
-
a(n) = if (n==0, 1, sumdiv(n, d, binomial(numdiv(n/d), d))); \\ Michel Marcus, May 13 2018
A351013
Number of integer compositions of n with all distinct runs.
Original entry on oeis.org
1, 1, 2, 4, 7, 14, 26, 48, 88, 161, 294, 512, 970, 1634, 2954, 5156, 9119, 15618, 27354, 46674, 80130, 138078, 232286, 394966, 665552, 1123231, 1869714, 3146410, 5186556, 8620936, 14324366, 23529274, 38564554, 63246744, 103578914, 167860584, 274465845
Offset: 0
The a(1) = 1 through a(5) = 14 compositions:
(1) (2) (3) (4) (5)
(1,1) (1,2) (1,3) (1,4)
(2,1) (2,2) (2,3)
(1,1,1) (3,1) (3,2)
(1,1,2) (4,1)
(2,1,1) (1,1,3)
(1,1,1,1) (1,2,2)
(2,2,1)
(3,1,1)
(1,1,1,2)
(1,1,2,1)
(1,2,1,1)
(2,1,1,1)
(1,1,1,1,1)
For example, the composition c = (3,1,1,1,1,2,1,1,3,4,1,1) has runs (3), (1,1,1,1), (2), (1,1), (3), (4), (1,1), and since (3) and (1,1) both appear twice, c is not counted under a(20).
The version for run-lengths instead of runs is
A329739, normal
A329740.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A116608 counts compositions by number of distinct parts.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329744 counts compositions by runs-resistance.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
-
A351202 = permutations of prime factors.
Cf.
A003242,
A025047,
A044813,
A098504,
A098859,
A106356,
A329738,
A328592,
A334028,
A351015,
A351201,
A351204.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Split[#]&]],{n,0,10}]
-
\\ here LahI is A111596 as row polynomials.
LahI(n,y) = {sum(k=1, n, y^k*(-1)^(n-k)*(n!/k!)*binomial(n-1, k-1))}
S(n) = {my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); 1 + sum(i=1, (sqrtint(8*n+1)-1)\2, polcoef(p,i,y)*LahI(i,y))}
seq(n)={my(q=S(n)); [subst(serlaplace(p),y,1) | p<-Vec(prod(k=1, n, subst(q + O(x*x^(n\k)), x, x^k)))]} \\ Andrew Howroyd, Feb 12 2022
A353848
Numbers k such that the k-th composition in standard order (row k of A066099) has all equal run-sums.
Original entry on oeis.org
0, 1, 2, 3, 4, 7, 8, 10, 11, 14, 15, 16, 31, 32, 36, 39, 42, 46, 59, 60, 63, 64, 127, 128, 136, 138, 143, 168, 170, 175, 187, 238, 248, 250, 255, 256, 292, 316, 487, 511, 512, 528, 543, 682, 750, 955, 1008, 1023, 1024, 2047, 2048, 2080, 2084, 2090, 2111, 2184
Offset: 0
The terms together with their binary expansions and corresponding compositions begin:
0: 0 ()
1: 1 (1)
2: 10 (2)
3: 11 (1,1)
4: 100 (3)
7: 111 (1,1,1)
8: 1000 (4)
10: 1010 (2,2)
11: 1011 (2,1,1)
14: 1110 (1,1,2)
15: 1111 (1,1,1,1)
16: 10000 (5)
31: 11111 (1,1,1,1,1)
32: 100000 (6)
36: 100100 (3,3)
39: 100111 (3,1,1,1)
42: 101010 (2,2,2)
46: 101110 (2,1,1,2)
59: 111011 (1,1,2,1,1)
60: 111100 (1,1,1,3)
For example:
- The 59th composition in standard order is (1,1,2,1,1), with run-sums (2,2,2), so 59 is in the sequence.
- The 2298th composition in standard order is (4,1,1,1,1,2,2), with run-sums (4,4,4), so 2298 is in the sequence.
- The 2346th composition in standard order is (3,3,2,2,2), with run-sums (6,6), so 2346 is in the sequence.
Standard compositions are listed by
A066099.
For equal lengths instead of sums we have
A353744, counted by
A329738.
These compositions are counted by
A353851.
The run-sums themselves are listed by
A353932, with
A353849 distinct terms.
A005811 counts runs in binary expansion.
A351014 counts distinct runs in standard compositions, firsts
A351015.
A353847 represents the run-sum transformation for compositions.
A353860 counts collapsible compositions.
A353863 counts run-sum-complete partitions.
Cf.
A003242,
A047966,
A106356,
A140690,
A238279,
A274174,
A333381,
A333489,
A333755,
A353832,
A353864.
-
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Select[Range[0,100],SameQ@@Total/@Split[stc[#]]&]
A353851
Number of integer compositions of n with all equal run-sums.
Original entry on oeis.org
1, 1, 2, 2, 5, 2, 8, 2, 12, 5, 8, 2, 34, 2, 8, 8, 43, 2, 52, 2, 70, 8, 8, 2, 282, 5, 8, 18, 214, 2, 386, 2, 520, 8, 8, 8, 1957, 2, 8, 8, 2010, 2, 2978, 2, 3094, 94, 8, 2, 16764, 5, 340, 8, 12310, 2, 26514, 8, 27642, 8, 8, 2, 132938, 2, 8, 238, 107411, 8, 236258
Offset: 0
The a(0) = 1 through a(8) = 12 compositions:
() (1) (2) (3) (4) (5) (6) (7) (8)
(11) (111) (22) (11111) (33) (1111111) (44)
(112) (222) (224)
(211) (1113) (422)
(1111) (2112) (2222)
(3111) (11114)
(11211) (41111)
(111111) (111122)
(112112)
(211211)
(221111)
(11111111)
For example:
(1,1,2,1,1) has run-sums (2,2,2) so is counted under a(6).
(4,1,1,1,1,2,2) has run-sums (4,4,4) so is counted under a(12).
(3,3,2,2,2) has run-sums (6,6) so is counted under a(12).
The version for parts or runs instead of run-sums is
A000005.
The version for multiplicities instead of run-sums is
A098504.
All parts are divisors of n, see
A100346.
The version for run-lengths instead of run-sums is
A329738, ptns
A047966.
These compositions are ranked by
A353848.
The distinct instead of equal version is
A353850.
A005811 counts runs in binary expansion.
A353847 represents the composition run-sum transformation.
Cf.
A000005,
A006881,
A238279,
A275870,
A333755,
A351014,
A351016,
A351017,
A353832,
A353834,
A353849,
A353853-
A353859 (run-sum trajectory),
A353860,
A353863,
A353864,
A353932.
-
Table[Length[Select[Join@@Permutations/@ IntegerPartitions[n],SameQ@@Total/@Split[#]&]],{n,0,15}]
-
a(n) = {if(n <=1, return(1)); my(d = divisors(n), res = 0); for(i = 1, #d, nd = numdiv(d[i]); res+=(nd*(nd-1)^(n/d[i]-1)) ); res } \\ David A. Corneth, Jun 02 2022
A353849
Number of distinct positive run-sums of the n-th composition in standard order.
Original entry on oeis.org
0, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 3, 3, 1, 2, 3, 1, 2, 3, 2, 1, 2, 2, 2, 3, 3, 3, 2, 2, 3, 2, 3, 2, 1, 1, 3, 2, 1, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3
Offset: 0
Composition 462903 in standard order is (1,1,4,7,1,2,1,1,1), with run-sums (2,4,7,1,2,3), of which a(462903) = 5 are distinct.
Counting repeated runs also gives
A124767.
Positions of first appearances are
A246534.
For distinct runs instead of run-sums we have
A351014 (firsts
A351015).
The run-sums themselves are listed by
A353932, with
A353849 distinct terms.
For distinct run-lengths instead of run-sums we have
A354579.
A005811 counts runs in binary expansion.
A066099 lists compositions in standard order.
A165413 counts distinct run-lengths in binary expansion.
A353847 represents the run-sum transformation for compositions.
Selected statistics of standard compositions:
- Number of distinct parts is
A334028.
Selected classes of standard compositions:
- Constant compositions are
A272919.
Cf.
A003242,
A044813,
A071625,
A238279,
A329738,
A333381,
A333489,
A333755,
A353744,
A353832,
A353850,
A353852,
A353866.
-
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Table[Length[Union[Total/@Split[stc[n]]]],{n,0,100}]
A382857
Number of ways to permute the prime indices of n so that the run-lengths are all equal.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 0, 1, 2, 1, 1, 1, 6, 1, 1, 2, 2, 2, 4, 1, 2, 2, 0, 1, 6, 1, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 0, 2, 0, 2, 2, 1, 6, 1, 2, 1, 1, 2, 6, 1, 1, 2, 6, 1, 1, 1, 2, 1, 1, 2, 6, 1, 0, 1, 2, 1, 6, 2, 2
Offset: 0
The prime indices of 216 are {1,1,1,2,2,2} and we have permutations:
(1,1,1,2,2,2)
(1,2,1,2,1,2)
(2,1,2,1,2,1)
(2,2,2,1,1,1)
so a(216) = 4.
The prime indices of 25920 are {1,1,1,1,1,1,2,2,2,2,3} and we have permutations:
(1,2,1,2,1,2,1,2,1,3,1)
(1,2,1,2,1,2,1,3,1,2,1)
(1,2,1,2,1,3,1,2,1,2,1)
(1,2,1,3,1,2,1,2,1,2,1)
(1,3,1,2,1,2,1,2,1,2,1)
so a(25920) = 5.
For distinct instead of equal run-lengths we have
A382771.
For run-sums instead of run-lengths we have
A382877, distinct
A382876.
Positions of first appearances are
A382878.
Positions of terms > 1 are
A383089.
A003963 gives product of prime indices.
A005811 counts runs in binary expansion.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A164707 lists numbers whose binary expansion has all equal run-lengths, distinct
A328592.
A353744 ranks compositions with equal run-lengths, counted by
A329738.
Cf.
A000720,
A000961,
A001221,
A001222,
A003242,
A008480,
A047966,
A238130,
A238279,
A351201,
A351293,
A351295.
-
Table[Length[Select[Permutations[Join@@ConstantArray@@@FactorInteger[n]], SameQ@@Length/@Split[#]&]],{n,0,100}]
Showing 1-10 of 75 results.
Comments