cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 19 results. Next

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

Views

Author

E. Rodney Canfield

Keywords

Examples

			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)
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 191.

Crossrefs

Row sums of A232396, A241701.
Cf. A241902.
Column k=1 of A261960.
Cf. A048272.
Compositions with adjacent parts coprime are A167606.
The complement is counted by A261983.

Programs

Formula

a(n) = Sum_{k=1..n} A048272(k)*a(n-k), n>1, a(0)=1. - Vladeta Jovovic, Feb 05 2002
G.f.: 1/(1 - Sum_{k>0} x^k/(1+x^k)).
a(n) ~ c r^n where c is approximately 0.456387 and r is approximately 1.750243. (Formula from Knopfmacher and Prodinger reference.) - Franklin T. Adams-Watters, May 27 2010. With better precision: r = 1.7502412917183090312497386246398158787782058181381590561316586... (see A241902), c = 0.4563634740588133495321001859298593318027266156100046548066205... - Vaclav Kotesovec, Apr 30 2014
G.f. is the special case p=2 of 1/(1 - Sum_{k>0} (z^k/(1-z^k) - p*z^(k*p)/(1-z^(k*p)))), see A129922. - Joerg Arndt, Apr 28 2013
G.f.: 1/(1 - x * (d/dx) log(Product_{k>=1} (1 + x^k)^(1/k))). - Ilya Gutkovskiy, Oct 18 2018
Moebius transform of A329738. - Gus Wiseman, Nov 27 2019
For n>=2, a(n) = A128695(n) - A091616(n). - Vaclav Kotesovec, Jul 07 2020

Extensions

More terms from David W. Wilson

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

Views

Author

Gus Wiseman, May 27 2021

Keywords

Comments

We define a composition to be alternating including twins (x,x) if there are no adjacent triples (..., x, y, z, ...) where x <= y <= z or x >= y >= z. Except in the case of twins (x,x), all such compositions are anti-runs (A003242). These compositions avoid the weak consecutive patterns (1,2,3) and (3,2,1), the strict version being A344614.
The version without twins (x,x) is A025047 (alternating compositions).

Examples

			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)
		

Crossrefs

A001250 counts alternating permutations.
A005649 counts anti-run patterns.
A025047 counts alternating or wiggly compositions, also A025048, A025049.
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:
- A011782 no conditions.
- A003242 avoiding (1,1) adjacent.
- A102726 avoiding (1,2,3).
- A106351 avoiding (1,1) adjacent by sum and length.
- A128695 avoiding (1,1,1) adjacent.
- A128761 avoiding (1,2,3) adjacent.
- A232432 avoiding (1,1,1).
- A335456 all patterns.
- A335457 all patterns adjacent.
- A335514 matching (1,2,3).
- A344614 avoiding (1,2,3) and (3,2,1) adjacent.
- A344615 weakly avoiding (1,2,3) adjacent.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z||x>=y>=z]&]],{n,0,15}]

Formula

a(n > 0) = A025047(n) + 1 if n is even, otherwise A025047(n). - Gus Wiseman, Nov 03 2021

Extensions

a(21)-a(40) from Alois P. Heinz, Nov 04 2021

A344614 Number of compositions of n with no adjacent triples (..., x, y, z, ...) where x < y < z or x > y > z.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 30, 58, 110, 209, 397, 753, 1429, 2711, 5143, 9757, 18511, 35117, 66621, 126389, 239781, 454897, 863010, 1637260, 3106138, 5892821, 11179603, 21209446, 40237641, 76337091, 144823431, 274752731, 521249018, 988891100, 1876081530, 3559220898, 6752400377
Offset: 0

Views

Author

Gus Wiseman, May 27 2021

Keywords

Comments

These compositions avoid the strict consecutive patterns (1,2,3) and (3,2,1), the weak version being A344604.

Examples

			The a(6) = 30 compositions are:
  (6)  (15)  (114)  (1113)  (11112)  (111111)
       (24)  (132)  (1122)  (11121)
       (33)  (141)  (1131)  (11211)
       (42)  (213)  (1212)  (12111)
       (51)  (222)  (1221)  (21111)
             (231)  (1311)
             (312)  (2112)
             (411)  (2121)
                    (2211)
                    (3111)
Missing are: (123), (321).
		

Crossrefs

A001250 counts alternating permutations.
A005649 counts anti-run patterns.
A025047 counts wiggly compositions (ascend: A025048, descend: A025049).
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.
A344604 counts wiggly compositions with twins.
A344605 counts wiggly patterns with twins.
A344606 counts wiggly permutations of prime factors with twins.
Counting compositions by patterns:
- A003242 avoiding (1,1) adjacent.
- A011782 no conditions.
- A106351 avoiding (1,1) adjacent by sum and length.
- A128695 avoiding (1,1,1) adjacent.
- A128761 avoiding (1,2,3).
- A232432 avoiding (1,1,1).
- A335456 all patterns.
- A335457 all patterns adjacent.
- A335514 matching (1,2,3).
- A344604 weakly avoiding (1,2,3) and (3,2,1) adjacent.
- A344614 avoiding (1,2,3) and (3,2,1) adjacent.
- A344615 weakly avoiding (1,2,3) adjacent.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,z_,_}/;xy>z]&]],{n,0,15}]

Extensions

More terms from Bert Dobbelaere, Jun 12 2021

A344615 Number of compositions of n with no adjacent triples (..., x, y, z, ...) where x <= y <= z.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 17, 29, 50, 84, 143, 241, 408, 688, 1162, 1959, 3305, 5571, 9393, 15832, 26688, 44980, 75812, 127769, 215338, 362911, 611620, 1030758, 1737131, 2927556, 4933760, 8314754, 14012668, 23615198, 39798098, 67070686, 113032453, 190490542, 321028554
Offset: 0

Views

Author

Gus Wiseman, May 27 2021

Keywords

Comments

These compositions avoid the weak consecutive pattern (1,2,3), the strict version being A128761.

Examples

			The a(1) = 1 through a(6) = 17 compositions:
  (1)  (2)    (3)    (4)      (5)        (6)
       (1,1)  (1,2)  (1,3)    (1,4)      (1,5)
              (2,1)  (2,2)    (2,3)      (2,4)
                     (3,1)    (3,2)      (3,3)
                     (1,2,1)  (4,1)      (4,2)
                     (2,1,1)  (1,3,1)    (5,1)
                              (2,1,2)    (1,3,2)
                              (2,2,1)    (1,4,1)
                              (3,1,1)    (2,1,3)
                              (1,2,1,1)  (2,3,1)
                                         (3,1,2)
                                         (3,2,1)
                                         (4,1,1)
                                         (1,2,1,2)
                                         (1,3,1,1)
                                         (2,1,2,1)
                                         (2,2,1,1)
		

Crossrefs

The case of permutations is A049774.
The strict non-adjacent version is A102726.
The case of permutations of prime indices is A344652.
A001250 counts alternating permutations.
A005649 counts anti-run patterns.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A344604 counts wiggly compositions with twins.
A344605 counts wiggly patterns with twins.
A344606 counts wiggly permutations of prime factors with twins.
Counting compositions by patterns:
- A003242 avoiding (1,1) adjacent.
- A011782 no conditions.
- A106351 avoiding (1,1) adjacent by sum and length.
- A128695 avoiding (1,1,1) adjacent.
- A128761 avoiding (1,2,3).
- A232432 avoiding (1,1,1).
- A335456 all patterns.
- A335457 all patterns adjacent.
- A335514 matching (1,2,3).
- A344604 weakly avoiding (1,2,3) and (3,2,1) adjacent.
- A344614 avoiding (1,2,3) and (3,2,1) adjacent.
- A344615 weakly avoiding (1,2,3) adjacent.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,z_,_}/;x<=y<=z]&]],{n,0,15}]

Extensions

More terms from Bert Dobbelaere, Jun 12 2021

A114938 Number of permutations of the multiset {1,1,2,2,...,n,n} with no two consecutive terms equal.

Original entry on oeis.org

1, 0, 2, 30, 864, 39480, 2631600, 241133760, 29083420800, 4467125013120, 851371260364800, 197158144895712000, 54528028997584665600, 17752366094818747392000, 6720318485119046923315200, 2927066537906697348594432000, 1453437879238150456164433920000
Offset: 0

Views

Author

Hugo Pfoertner, Jan 08 2006

Keywords

Comments

a(n) is also the number of (0,1)-matrices A=(a_ij) of size n X 2n such that each row has exactly two 1's and each column has exactly one 1 and with the restriction that no 1 stands on the line from a_11 to a_22. - Shanzhen Gao, Feb 24 2010
a(n) is the number of permutations of the multiset {1,1,2,2,...,n,n} with no fixed points. - Alexander Burstein, May 16 2020
Also the number of 2-uniform ordered set partitions of {1...2n} containing no two successive vertices in the same block. - Gus Wiseman, Jul 04 2020

Examples

			a(2) = 2 because there are two permutations of {1,1,2,2} avoiding equal consecutive terms: 1212 and 2121.
		

References

  • R. P. Stanley, Enumerative Combinatorics Volume I, Cambridge University Press, 1997. Chapter 2, Sieve Methods, Example 2.2.3, page 68.

Crossrefs

Cf. A114939 = preferred seating arrangements of n couples.
Cf. A007060 = arrangements of n couples with no adjacent spouses; A007060(n) = 2^n * A114938(n) (this sequence).
Cf. A278990 = number of loopless linear chord diagrams with n chords.
Cf. A000806 = Bessel polynomial y_n(-1).
The version for multisets with prescribed multiplicities is A335125.
The version for prime indices is A335452.
Anti-run compositions are counted by A003242.
Anti-run compositions are ranked by A333489.
Inseparable partitions are counted by A325535.
Inseparable partitions are ranked by A335448.
Separable partitions are counted by A325534.
Separable partitions are ranked by A335433.
Other sequences involving the multiset {1,1,2,2,...,n,n}: A001147, A007717, A020555, A094574, A316972.
Row n=2 of A322093.

Programs

  • Magma
    [1] cat [n le 2 select 2*(n-1) else n*(2*n-1)*Self(n-1) + (n-1)*n*Self(n-2): n in [1..20]]; // Vincenzo Librandi, Aug 10 2015
    
  • Mathematica
    Table[Sum[Binomial[n,i](2n-i)!/2^(n-i) (-1)^i,{i,0,n}],{n,0,20}]  (* Geoffrey Critzer, Jan 02 2013, and adapted to the extension by Stefano Spezia, Nov 15 2018 *)
    Table[Length[Select[Permutations[Join[Range[n],Range[n]]],!MatchQ[#,{_,x_,x_,_}]&]],{n,0,5}] (* Gus Wiseman, Jul 04 2020 *)
  • PARI
    A114938(n)=sum(k=0, n, binomial(n, k)*(-1)^(n-k)*(n+k)!/2^k);
    vector(20, n, A114938(n-1)) \\ Michel Marcus, Aug 10 2015
    
  • SageMath
    def A114938(n): return (-1)^n*sum(binomial(n,k)*factorial(n+k)//(-2)^k for k in range(n+1))
    [A114938(n) for n in range(31)] # G. C. Greubel, Sep 26 2023

Formula

a(n) = Sum_{k=0..n} ((binomial(n, k)*(-1)^(n-k)*(n+k)!)/2^k).
a(n) = (-1)^n * n! * A000806(n), n>0. - Vladeta Jovovic, Nov 19 2009
a(n) = n*(2*n-1)*a(n-1) + (n-1)*n*a(n-2). - Vaclav Kotesovec, Aug 07 2013
a(n) ~ 2^(n+1)*n^(2*n)*sqrt(Pi*n)/exp(2*n+1). - Vaclav Kotesovec, Aug 07 2013
a(n) = n! * A278990(n). - Alexander Burstein, May 16 2020
From G. C. Greubel, Sep 26 2023: (Start)
a(n) = (-1)^n * (i/e)*sqrt(2/Pi) * n! * BesselK(n+1/2, -1).
a(n) = [n! * (1/x) * p_{n+1}(x)]|A104548%20for%20p">{x= -1} (See A104548 for p{n}(x)).
E.g.f.: sqrt(Pi/(2*x)) * exp(-(1+x)^2/(2*x)) * erfi((1+x)/sqrt(2*x)).
Sum_{n >= 0} a(n)*x^n/(n!)^2 = exp(sqrt(1-2*x))/sqrt(1-2*x).
Sum_{n >= 0} a(n)*x^n/(n!*(n+1)!) = ( 1 - exp(-1 + sqrt(1-2*x)) )/x. (End)

Extensions

a(0)=1 prepended by Seiichi Manyama, Nov 15 2018

A232432 Number of compositions of n avoiding the pattern 111.

Original entry on oeis.org

1, 1, 2, 3, 7, 11, 21, 34, 59, 114, 178, 284, 522, 823, 1352, 2133, 3739, 5807, 9063, 14074, 23639, 36006, 56914, 87296, 131142, 214933, 324644, 487659, 739291, 1108457, 1724673, 2558386, 3879335, 5772348, 8471344, 12413666, 19109304, 27886339, 40816496
Offset: 0

Views

Author

Alois P. Heinz, Nov 23 2013

Keywords

Comments

Number of compositions of n into parts with multiplicity <= 2.

Examples

			a(4) = 7: [4], [3,1], [2,2], [1,3], [2,1,1], [1,2,1], [1,1,2].
a(5) = 11: [5], [4,1], [3,2], [2,3], [1,4], [3,1,1], [2,2,1], [1,3,1], [2,1,2], [1,2,2], [1,1,3].
a(6) = 21: [6], [4,2], [3,3], [5,1], [2,4], [1,5], [2,1,3], [1,2,3], [1,1,4], [4,1,1], [3,2,1], [2,3,1], [1,4,1], [3,1,2], [1,3,2], [1,2,2,1], [2,1,1,2], [1,2,1,2], [1,1,2,2], [2,2,1,1], [2,1,2,1].
		

Crossrefs

Cf. A000726 (partitions avoiding 111), A032020 (pattern 11), A128695 (adjacent pattern 111).
Column k=2 of A243081.
The case of partitions is ranked by A004709.
The version for patterns is A080599.
(1,1,1,1)-avoiding partitions are counted by A232464.
The (1,1,1)-matching version is A335455.
Patterns matched by compositions are counted by A335456.
The version for prime indices is A335511.
(1,1,1)-avoiding compositions are ranked by A335513.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          add(b(n-i*j, i-1, p+j)/j!, j=0..min(n/i, 2))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..50);
  • Mathematica
    f[list_]:=Apply[And,Table[Count[list,i]<3,{i,1,Max[list]}]];
    g[list_]:=Length[list]!/Apply[Times,Table[Count[list,i]!,{i,1,Max[list]}]];
    a[n_] := If[n == 0, 1, Total[Map[g, Select[IntegerPartitions[n], f]]]];
    Table[a[n], {n, 0, 35}] (* Geoffrey Critzer, Nov 25 2013, updated by Jean-François Alcover, Nov 20 2023 *)

A335464 Number of compositions of n with a run of length > 2.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 8, 18, 39, 86, 188, 406, 865, 1836, 3874, 8135, 17003, 35413, 73516, 152171, 314151, 647051, 1329936, 2728341, 5587493, 11424941, 23327502, 47567628, 96879029, 197090007, 400546603, 813258276, 1649761070, 3343936929, 6772740076, 13707639491
Offset: 0

Views

Author

Gus Wiseman, Jul 06 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Also compositions contiguously matching the pattern (1,1,1).

Examples

			The a(3) = 1 through a(7) = 18 compositions:
  (111)  (1111)  (1112)   (222)     (1114)
                 (2111)   (1113)    (1222)
                 (11111)  (3111)    (2221)
                          (11112)   (4111)
                          (11121)   (11113)
                          (12111)   (11122)
                          (21111)   (11131)
                          (111111)  (13111)
                                    (21112)
                                    (22111)
                                    (31111)
                                    (111112)
                                    (111121)
                                    (111211)
                                    (112111)
                                    (121111)
                                    (211111)
                                    (1111111)
		

Crossrefs

Compositions contiguously avoiding (1,1) are A003242.
Compositions with some part > 2 are A008466.
Compositions by number of adjacent equal parts are A106356.
Compositions where each part is adjacent to an equal part are A114901.
Compositions contiguously avoiding (1,1,1) are A128695.
Compositions with adjacent parts coprime are A167606.
Compositions contiguously matching (1,1) are A261983.
Compositions with all equal parts contiguous are A274174.
Patterns contiguously matched by compositions are A335457.

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, add(`if`(abs(t)<>j,
           b(n-j, j), `if`(t=-j, 0, b(n-j, -j))), j=1..n))
        end:
    a:= n-> ceil(2^(n-1))-b(n, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, Jul 06 2020
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],MatchQ[#,{_,x_,x_,x_,_}]&]],{n,0,10}]
    (* Second program: *)
    b[n_, t_] := b[n, t] = If[n == 0, 1, Sum[If[Abs[t] != j,
         b[n - j, j], If[t == -j, 0, b[n - j, -j]]], {j, 1, n}]];
    a[n_] := Ceiling[2^(n-1)] - b[n, 0];
    a /@ Range[0, 40] (* Jean-François Alcover, May 21 2021, after Alois P. Heinz *)

Formula

a(n) = A011782(n) - A128695(n). - Alois P. Heinz, Jul 06 2020

Extensions

a(23)-a(35) from Alois P. Heinz, Jul 06 2020

A091613 Triangle: T(n,k) = number of compositions (ordered partitions) of n such that some part is repeated consecutively k times and no part is repeated consecutively more than k times.

Original entry on oeis.org

1, 1, 1, 3, 0, 1, 4, 3, 0, 1, 7, 6, 2, 0, 1, 14, 10, 5, 2, 0, 1, 23, 23, 11, 4, 2, 0, 1, 39, 50, 22, 10, 4, 2, 0, 1, 71, 99, 48, 22, 9, 4, 2, 0, 1, 124, 200, 105, 46, 21, 9, 4, 2, 0, 1, 214, 404, 223, 101, 46, 20, 9, 4, 2, 0, 1, 378, 805, 468, 218, 98, 45, 20, 9, 4, 2, 0, 1, 661, 1599, 979, 466, 213, 98, 44, 20, 9, 4, 2, 0, 1
Offset: 1

Views

Author

Christian G. Bower, Jan 23 2004

Keywords

Comments

Cf. A232294 - A128695 = column 3. - Geoffrey Critzer, Mar 24 2014

Examples

			Triangle starts:
    1;
    1,   1;
    3,   0,   1;
    4,   3,   0,  1;
    7,   6,   2,  0,  1;
   14,  10,   5,  2,  0, 1;
   23,  23,  11,  4,  2, 0, 1;
   39,  50,  22, 10,  4, 2, 0, 1;
   71,  99,  48, 22,  9, 4, 2, 0, 1;
  124, 200, 105, 46, 21, 9, 4, 2, 0, 1;
  ...
In the partition 3+3+2+2+2+1+3+3+1, 2 is repeated consecutively 3 times, no part is repeated consecutively more than 3 times. (3 appears 4 times nonconsecutively.)
		

Crossrefs

Row sums: A000079(n-1) (2^(n-1)).
Inverse: A091614.
Square: A091615.
Convergent of columns: A034007.

Programs

  • Maple
    b:= proc(n, l, k) option remember; `if`(n=0, 1, add(`if`(
          i=l, 0, add(b(n-i*j, i, k), j=1..min(k, n/i))), i=1..n))
        end:
    T:= (n, k)-> b(n, 0, k)-b(n, 0, k-1):
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Feb 08 2017
  • Mathematica
    nn=15;Table[Take[Drop[Transpose[Map[PadRight[#,nn+1]&,Table[ CoefficientList[Series[1/(1-Sum[Sum[x^(j i),{i,1,k}]/Sum[x^(j i),{i,0,k}],{j,1,nn}])-1/(1-Sum[Sum[x^(j i),{i,1,k-1}]/Sum[x^(j i),{i,0,k-1}],{j,1,nn}]),{x,0,nn}],x],{k,1,nn}]]],1][[n]],n],{n,1,nn}]//Grid
    (* or *)
    Needs["Combinatorica`"];Table[Distribution[Map[Max,Map[Length,Map[Split, Level[Map[Permutations,IntegerPartitions[n,n]],{2}]],{2}]],Range[1,n]],{n,1,15}]//Grid (* Geoffrey Critzer, Mar 24 2014 *)
    b[n_, l_, k_] := b[n, l, k] = If[n == 0, 1, Sum[If[i == l, 0,
         Sum[b[n - i*j, i, k], {j, 1, Min[k, n/i]}]], {i, 1, n}]];
    T[n_, k_] := b[n, 0, k] - b[n, 0, k - 1];
    Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 04 2021, after Alois P. Heinz *)

Formula

G.f. for column k: 1/(1 - Sum_{i>=1} (x^i + x^(2*i) + ... + x^(k*i))/( 1 + x^i + x^(2*i) + ... + x^(k*i)) ) - 1/(1 - Sum_{i>=1} (x^i + x^(2*i) + ... + x^((k-1)*i))/( 1 + x^i + x^(2*i) + ... + x^((k-1)*i))). - Geoffrey Critzer, Mar 24 2014

A353400 Number of integer compositions of n with all run-lengths > 2.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 2, 1, 2, 4, 4, 5, 11, 11, 14, 27, 29, 37, 61, 72, 97, 147, 181, 246, 368, 470, 632, 914, 1198, 1611, 2286, 3018, 4079, 5709, 7619, 10329, 14333, 19258, 26142, 36069, 48688, 66114, 90800, 122913, 167020, 228735, 310167, 421708, 576499, 782803
Offset: 0

Views

Author

Gus Wiseman, May 15 2022

Keywords

Examples

			The a(7) = 1 through a(12) = 11 compositions:
  1111111   2222       333         22222        1112222       444
            11111111   111222      1111222      2222111       3333
                       222111      2221111      11111222      111333
                       111111111   1111111111   22211111      222222
                                                11111111111   333111
                                                              11112222
                                                              22221111
                                                              111111222
                                                              111222111
                                                              222111111
                                                              111111111111
		

Crossrefs

The = 2 version is A003242 aerated.
The <= 1 version is A003242 ranked by A333489.
The version for parts instead of run-lengths is A078012, both A353428.
The version for partitions is A100405.
The > 1 version is A114901, ranked by A353427.
The <= 2 version is A128695, matching A335464.
A008466 counts compositions with some part > 2.
A011782 counts compositions.
A106356 counts compositions by number of adjacent equal parts.
A274174 counts compositions with equal parts contiguous.
A329738 counts uniform compositions, partitions A047966.
A329739 counts compositions with all distinct run-lengths.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(
         `if`(i<>h, add(b(n-i*j, i), j=3..n/i), 0), i=1..n/3))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, May 17 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@ IntegerPartitions[n],!MemberQ[Length/@Split[#],1|2]&]],{n,0,15}]

Extensions

a(21)-a(49) from Alois P. Heinz, May 17 2022

A353401 Number of integer compositions of n with all prime run-lengths.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 4, 3, 6, 9, 10, 18, 27, 35, 54, 83, 107, 176, 242, 354, 515, 774, 1070, 1648, 2332, 3429, 4984, 7326, 10521, 15591, 22517, 32908, 48048, 70044, 101903, 149081, 216973, 316289, 461959, 672664, 981356, 1431256, 2086901, 3041577, 4439226, 6467735
Offset: 0

Views

Author

Gus Wiseman, May 15 2022

Keywords

Examples

			The a(0) = 1 through a(9) = 9 compositions (empty column indicated by dot, 0 is the empty composition):
  0   .  11   111   22   11111   33     11122     44       333
                                 222    22111     1133     11133
                                 1122   1111111   3311     33111
                                 2211             11222    111222
                                                  22211    222111
                                                  112211   1111122
                                                           1112211
                                                           1122111
                                                           2211111
		

Crossrefs

The case of runs equal to 2 is A003242 aerated.
The <= 1 version is A003242 ranked by A333489.
The version for parts instead of run-lengths is A023360, both A353429.
The version for partitions is A055923.
The > 1 version is A114901, ranked by A353427.
The <= 2 version is A128695, matching A335464.
The > 2 version is A353400, partitions A100405.
Words with all distinct run-lengths: A032020, A044813, A098859, A130091, A329739, A351013, A351017.
A005811 counts runs in binary expansion.
A008466 counts compositions with some part > 2.
A011782 counts compositions.
A167606 counts compositions with adjacent parts coprime.
A329738 counts uniform compositions, partitions A047966.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(`if`(i<>h, add(
         `if`(isprime(j), b(n-i*j, i), 0), j=2..n/i), 0), i=1..n/2))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, May 18 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Length/@Split[#],_?(!PrimeQ[#]&)]&]],{n,0,15}]

Extensions

a(21)-a(45) from Alois P. Heinz, May 18 2022
Showing 1-10 of 19 results. Next