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 11 results. Next

A235999 Triangle read by rows: T(n,k) = 2^k*A235998(n,k), n>=1, k>=1.

Original entry on oeis.org

2, 4, 4, 8, 6, 20, 4, 56, 8, 88, 48, 4, 176, 144, 8, 272, 448, 6, 428, 1168, 8, 688, 2496, 384, 4, 1044, 5416, 1344, 12, 1584, 10864, 4608, 4, 2424, 21328, 13152, 8, 3800, 40096, 35616, 8, 5656, 76336, 84864, 3840, 10, 8952, 140248, 200224, 15360
Offset: 1

Views

Author

Omar E. Pol, Jan 19 2014

Keywords

Comments

T(n,k) is also the number of overcompositions of n having k distinct parts. For the definition of overcomposition see A236002.
Row n has length A003056(n) hence the first element of column k is in row A000217(k).
Row sums give A236002, n >= 1.
Column 1 is A062011.
T(k*(k+1)/2,k) = T(A000217(k),k) = A000165(k) = (2*k)!!. - Alois P. Heinz, Jan 20 2014

Examples

			Triangle begins:
2;
4;
4,     8;
6,    20;
4,    56;
8,    88,     48;
4,   176,    144;
8,   272,    448;
6,   428,   1168;
8,   688,   2496,    384;
4,  1044,   5416,   1344;
12, 1584,  10864,   4608;
4,  2424,  21328,  13152;
8,  3800,  40096,  35616;
8,  5656,  76336,  84864,  3840;
10, 8952, 140248, 200224, 15360;
...
		

Crossrefs

Extensions

More terms from Alois P. Heinz, Jan 20 2014

A131689 Triangle of numbers T(n,k) = k!*Stirling2(n,k) = A000142(k)*A048993(n,k) read by rows, T(n, k) for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 6, 6, 0, 1, 14, 36, 24, 0, 1, 30, 150, 240, 120, 0, 1, 62, 540, 1560, 1800, 720, 0, 1, 126, 1806, 8400, 16800, 15120, 5040, 0, 1, 254, 5796, 40824, 126000, 191520, 141120, 40320, 0, 1, 510, 18150, 186480, 834120, 1905120, 2328480, 1451520, 362880
Offset: 0

Views

Author

Philippe Deléham, Sep 14 2007

Keywords

Comments

Triangle T(n,k), 0 <= k <= n, read by rows given by [0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,...] DELTA [1,1,2,2,3,3,4,4,5,5,6,6,...] where DELTA is the operator defined in A084938; another version of A019538.
See also A019538: version with n > 0 and k > 0. - Philippe Deléham, Nov 03 2008
From Peter Bala, Jul 21 2014: (Start)
T(n,k) gives the number of (k-1)-dimensional faces in the interior of the first barycentric subdivision of the standard (n-1)-dimensional simplex. For example, the barycentric subdivision of the 1-simplex is o--o--o, with 1 interior vertex and 2 interior edges, giving T(2,1) = 1 and T(2,2) = 2.
This triangle is used when calculating the face vectors of the barycentric subdivision of a simplicial complex. Let S be an n-dimensional simplicial complex and write f_k for the number of k-dimensional faces of S, with the usual convention that f_(-1) = 1, so that F := (f_(-1), f_0, f_1,...,f_n) is the f-vector of S. If M(n) denotes the square matrix formed from the first n+1 rows and n+1 columns of the present triangle, then the vector F*M(n) is the f-vector of the first barycentric subdivision of the simplicial complex S (Brenti and Welker, Lemma 2.1). For example, the rows of Pascal's triangle A007318 (but with row and column indexing starting at -1) are the f-vectors for the standard n-simplexes. It follows that A007318*A131689, which equals A028246, is the array of f-vectors of the first barycentric subdivision of standard n-simplexes. (End)
This triangle T(n, k) appears in the o.g.f. G(n, x) = Sum_{m>=0} S(n, m)*x^m with S(n, m) = Sum_{j=0..m} j^n for n >= 1 as G(n, x) = Sum_{k=1..n} (x^k/(1 - x)^(k+2))*T(n, k). See also the Eulerian triangle A008292 with a Mar 31 2017 comment for a rewritten form. For the e.g.f. see A028246 with a Mar 13 2017 comment. - Wolfdieter Lang, Mar 31 2017
T(n,k) = the number of alignments of length k of n strings each of length 1. See Slowinski. An example is given below. Cf. A122193 (alignments of strings of length 2) and A299041 (alignments of strings of length 3). - Peter Bala, Feb 04 2018
The row polynomials R(n,x) are the Fubini polynomials. - Emanuele Munarini, Dec 05 2020
From Gus Wiseman, Feb 18 2022: (Start)
Also the number of patterns of length n with k distinct parts (or with maximum part k), where we define a pattern to be a finite sequence covering an initial interval of positive integers. For example, row n = 3 counts the following patterns:
(1,1,1) (1,2,2) (1,2,3)
(2,1,2) (1,3,2)
(2,2,1) (2,1,3)
(1,1,2) (2,3,1)
(1,2,1) (3,1,2)
(2,1,1) (3,2,1)
(End)
Regard A048994 as a lower-triangular matrix and divide each term A048994(n,k) by n!, then this is the matrix inverse. Because Sum_{k=0..n} (A048994(n,k) * x^n / n!) = A007318(x,n), Sum_{k=0..n} (A131689(n,k) * A007318(x,k)) = x^n. - Natalia L. Skirrow, Mar 23 2023
T(n,k) is the number of ordered partitions of [n] into k blocks. - Alois P. Heinz, Feb 21 2025

Examples

			The triangle T(n,k) begins:
  n\k 0 1    2     3      4       5        6        7        8        9      10 ...
  0:  1
  1:  0 1
  2:  0 1    2
  3:  0 1    6     6
  4:  0 1   14    36     24
  5:  0 1   30   150    240     120
  6:  0 1   62   540   1560    1800      720
  7:  0 1  126  1806   8400   16800    15120     5040
  8:  0 1  254  5796  40824  126000   191520   141120    40320
  9:  0 1  510 18150 186480  834120  1905120  2328480  1451520   362880
  10: 0 1 1022 55980 818520 5103000 16435440 29635200 30240000 16329600 3628800
  ... reformatted and extended. - _Wolfdieter Lang_, Mar 31 2017
From _Peter Bala_, Feb 04 2018: (Start)
T(4,2) = 14 alignments of length 2 of 4 strings of length 1. Examples include
  (i) A -    (ii) A -    (iii) A -
      B -         B -          - B
      C -         - C          - C
      - D         - D          - D
There are C(4,1) = 4 alignments of type (i) with a single gap character - in column 1, C(4,2) = 6 alignments of type (ii) with two gap characters in column 1 and C(4,3) = 4 alignments of type (iii) with three gap characters in column 1, giving a total of 4 + 6 + 4 = 14 alignments. (End)
		

Crossrefs

Case m=1 of the polynomials defined in A278073.
Cf. A000142 (diagonal), A000670 (row sums), A000012 (alternating row sums), A210029 (central terms).
Cf. A008292, A028246 (o.g.f. and e.g.f. of sums of powers).
A version for partitions is A116608, or by maximum A008284.
A version for compositions is A235998, or by maximum A048004.
Classes of patterns:
- A000142 = strict
- A005649 = anti-run, complement A069321
- A019536 = necklace
- A032011 = distinct multiplicities
- A060223 = Lyndon
- A226316 = (1,2,3)-avoiding, weakly A052709, complement A335515
- A296975 = aperiodic
- A345194 = alternating, up/down A350354, complement A350252
- A349058 = weakly alternating
- A351200 = distinct runs
- A351292 = distinct run-lengths

Programs

  • Julia
    function T(n, k)
        if k < 0 || k > n return 0 end
        if n == 0 && k == 0 return 1 end
        k*(T(n-1, k-1) + T(n-1, k))
    end
    for n in 0:7
        println([T(n, k) for k in 0:n])
    end
    # Peter Luschny, Mar 26 2020
    
  • Maple
    A131689 := (n,k) -> Stirling2(n,k)*k!: # Peter Luschny, Sep 17 2011
    # Alternatively:
    A131689_row := proc(n) 1/(1-t*(exp(x)-1)); expand(series(%,x,n+1)); n!*coeff(%,x,n); PolynomialTools:-CoefficientList(%,t) end:
    for n from 0 to 9 do A131689_row(n) od; # Peter Luschny, Jan 23 2017
  • Mathematica
    t[n_, k_] := k!*StirlingS2[n, k]; Table[t[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 25 2014 *)
    T[n_, k_] := If[n <= 0 || k <= 0, Boole[n == 0 && k == 0], Sum[(-1)^(i + k) Binomial[k, i] i^(n + k), {i, 0, k}]]; (* Michael Somos, Jul 08 2018 *)
  • PARI
    {T(n, k) = if( n<0, 0, sum(i=0, k, (-1)^(k + i) * binomial(k, i) * i^n))};
    /* Michael Somos, Jul 08 2018 */
    
  • SageMath
    @cached_function
    def F(n): # Fubini polynomial
        R. = PolynomialRing(ZZ)
        if n == 0: return R(1)
        return R(sum(binomial(n, k)*F(n - k)*x for k in (1..n)))
    for n in (0..9): print(F(n).list()) # Peter Luschny, May 21 2021

Formula

T(n,k) = k*(T(n-1,k-1) + T(n-1,k)) with T(0,0)=1. Sum_{k=0..n} T(n,k)*x^k = (-1)^n*A000629(n), A033999(n), A000007(n), A000670(n), A004123(n+1), A032033(n), A094417(n), A094418(n), A094419(n) for x = -2, -1, 0, 1, 2, 3, 4, 5, 6 respectively. [corrected by Philippe Deléham, Feb 11 2013]
Sum_{k=0..n} T(n,k)*x^(n-k) = A000012(n), A000142(n), A000670(n), A122704(n) for x=-1, 0, 1, 2 respectively. - Philippe Deléham, Oct 09 2007
Sum_{k=0..n} (-1)^k*T(n,k)/(k+1) = Bernoulli numbers A027641(n)/A027642(n). - Peter Luschny, Sep 17 2011
G.f.: F(x,t) = 1 + x*t + (x+x^2)*t^2/2! + (x+6*x^2+6*x^3)*t^3/3! + ... = Sum_{n>=0} R(n,x)*t^n/n!.
The row polynomials R(n,x) satisfy the recursion R(n+1,x) = (x+x^2)*R'(n,x) + x*R(n,x) where ' indicates differentiation with respect to x. - Philippe Deléham, Feb 11 2013
T(n,k) = [t^k] (n! [x^n] (1/(1-t*(exp(x)-1)))). - Peter Luschny, Jan 23 2017
The n-th row polynomial has the form x o x o ... o x (n factors), where o denotes the black diamond multiplication operator of Dukes and White. See also Bala, Example E8. - Peter Bala, Jan 08 2018

A325676 Number of compositions of n such that every distinct consecutive subsequence has a different sum.

Original entry on oeis.org

1, 1, 2, 4, 5, 10, 12, 24, 26, 47, 50, 96, 104, 172, 188, 322, 335, 552, 590, 938, 1002, 1612, 1648, 2586, 2862, 4131, 4418, 6718, 7122, 10332, 11166, 15930, 17446, 24834, 26166, 37146, 41087, 55732, 59592, 84068, 89740, 122106, 133070, 177876, 194024, 262840, 278626
Offset: 0

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Compare to the definition of knapsack partitions (A108917).

Examples

			The distinct consecutive subsequences of (1,4,4,3) together with their sums are:
   1: {1}
   3: {3}
   4: {4}
   5: {1,4}
   7: {4,3}
   8: {4,4}
   9: {1,4,4}
  11: {4,4,3}
  12: {1,4,4,3}
Because the sums are all different, (1,4,4,3) is counted under a(12).
The a(1) = 1 through a(6) = 12 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (1111)  (41)     (42)
                            (113)    (51)
                            (122)    (114)
                            (221)    (132)
                            (311)    (222)
                            (11111)  (231)
                                     (411)
                                     (111111)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@Union[ReplaceList[#,{_,s__,_}:>{s}]]&]],{n,0,15}]

Extensions

a(21)-a(22) from Jinyuan Wang, Jun 20 2020
a(23)-a(25) from Robert Price, Jun 19 2021
a(26)-a(46) from Fausto A. C. Cariboni, Feb 10 2022

A236002 Number of overcompositions of n.

Original entry on oeis.org

1, 2, 4, 12, 26, 60, 144, 324, 728, 1602, 3576, 7808, 17068, 36908, 79520, 170704, 364794, 777036, 1649456, 3491188, 7367544, 15513336, 32584648, 68307264, 142904080, 298448914, 622235060, 1295320004, 2692583916, 5589586996, 11588905844, 23999052692
Offset: 0

Views

Author

Omar E. Pol, Jan 19 2014

Keywords

Comments

Analog to overpartitions, here an overcomposition is defined to be a composition in which the first occurrence of each distinct number may be overlined (see example).
Also 1 together with the row sums of A235999.
For the number of partitions of n see A000041.
For the number of compositions of n see A011782.
For the number of overpartitions of n see A015128.
Note that there are several orderings of overcompositions, the same as the orderings of compositions, but apparently for every ordering of overcompositions there are also several suborderings according to the arrangements of the overlined parts. The same for overpartitions. See one of them in Example section.

Examples

			For n = 4 the 26 overcompositions of 4 are: [4], [4'], [1,3], [1',3], [1,3'], [1',3'], [2,2], [2',2], [1,1,2], [1',1,2], [1,1,2'], [1',1,2'], [3,1], [3',1], [3,1'], [3',1'], [1,2,1], [1',2,1], [1,2',1], [1',2',1], [2,1,1], [2',1,1], [2,1',1], [2',1',1], [1,1,1,1], [1',1,1,1].
		

Crossrefs

Formula

a(n) = Sum_{k=1..A003056(n)} 2^k*A235998(n,k), n >= 1.

Extensions

a(7) corrected and more terms added, Joerg Arndt, Jan 20 2014
a(19)-a(31) from Alois P. Heinz, Jan 20 2014

A355388 Number of composable pairs (y, v) of integer compositions of n, where a composition is regarded as an arrow from the number of parts to the number of distinct parts.

Original entry on oeis.org

1, 1, 2, 6, 18, 58, 174, 536, 1656, 4947, 14800, 43157, 126572, 364070, 1039926, 2938898, 8223400, 22846370, 62930113, 172177400, 467002792, 1259736804, 3371190792, 8973530491, 23728305128, 62421018163, 163255839779, 424842462529, 1100006243934, 2834558927244, 7270915592897
Offset: 0

Views

Author

Gus Wiseman, Jul 02 2022

Keywords

Comments

Being composable here means that the length of v equals the number of distinct parts in y.

Examples

			The a(0) = 1 through a(4) = 18 pairs:
  ()()  (1)(1)  (2)(2)   (3)(3)    (4)(4)
                (11)(2)  (21)(21)  (31)(31)
                         (21)(12)  (31)(13)
                         (12)(21)  (31)(22)
                         (12)(12)  (13)(31)
                         (111)(3)  (13)(13)
                                   (13)(22)
                                   (22)(4)
                                   (211)(31)
                                   (211)(13)
                                   (211)(22)
                                   (121)(31)
                                   (121)(13)
                                   (121)(22)
                                   (112)(31)
                                   (112)(13)
                                   (112)(22)
                                   (1111)(4)
		

Crossrefs

The case with containment is A032020.
The inhomogeneous version with containment is A355384, partitions A355383.
The version for partitions is A355385, with containment A000009.
A133494 counts compositions of each part of a composition, strict A336139.
A323583 counts splittings of partitions.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          expand(add(b(n-i*j, i-1, p+j)/j!*`if`(j=0, 1, x), j=0..n/i))))
        end:
    a:= n-> (p-> add(coeff(p, x, i)*binomial(n-1, i-1), i=0..degree(p)))(b(n$2, 0)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jan 01 2023
  • Mathematica
    Table[Length[Select[Tuples[Join@@Permutations/@IntegerPartitions[n],2], Length[Union[#[[1]]]]==Length[#[[2]]]&]],{n,0,10}]
  • PARI
    a(n) = {if(n==0, 1, my(s=0); forpart(p=n, p=Vec(p); my(S=Set(p)); s += binomial(n-1, #S-1)*(#p)!/prod(i=1, #S, my(c=#select(t->t==S[i], p)); c! )); s)} \\ Andrew Howroyd, Jan 01 2023
    
  • PARI
    \\ for larger n.
    a(n) = { local(Cache=Map());
      my(F(r,m,p,q) = my(key=[r,m,p,q], z); if(!mapisdefined(Cache, key, &z),
      z = if(m==0, if(r==0, p!*binomial(n-1, q-1)), self()(r, m-1, p, q) + sum(j=1, r\m, self()(r-j*m, min(m-1, r-j*m), p+j, q+1)/j!));
      mapput(Cache, key, z) ); z);
      if(n==0, 1, F(n, n, 0, 0))
    } \\ Andrew Howroyd, Jan 01 2023

Formula

a(n) = Sum_{k>=1} binomial(n-1, k-1)*A235998(n, k) for n > 0. - Andrew Howroyd, Jan 01 2023

Extensions

Terms a(14) and beyond from Andrew Howroyd, Jan 01 2023

A325556 Number of necklace compositions of n with distinct circular differences up to sign.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 7, 9, 13, 25, 27, 51, 63, 95, 123, 179, 205, 305, 409, 559, 715, 1009, 1337, 1869
Offset: 1

Views

Author

Gus Wiseman, May 11 2019

Keywords

Comments

A necklace composition of n is a finite sequence of positive integers summing to n that is lexicographically minimal among all of its cyclic rotations.
The circular differences of a composition c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).

Examples

			The a(1) = 1 through a(10) = 13 necklace compositions:
  (1)  (2)  (3)  (4)  (5)  (6)  (7)    (8)     (9)     (A)
                                (124)  (125)   (126)   (127)
                                (142)  (134)   (162)   (136)
                                       (143)   (1125)  (145)
                                       (152)   (1134)  (154)
                                       (1124)  (1143)  (163)
                                       (1142)  (1152)  (172)
                                               (1224)  (235)
                                               (1422)  (253)
                                                       (1126)
                                                       (1162)
                                                       (1225)
                                                       (1522)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Abs[Differences[Append[#,First[#]]]]&&neckQ[#]&]],{n,15}]

A131661 Number of compositions of n such that the cardinality of the set of parts is 2.

Original entry on oeis.org

0, 0, 2, 5, 14, 22, 44, 68, 107, 172, 261, 396, 606, 950, 1414, 2238, 3418, 5411, 8368, 13297, 20840, 33268, 52549, 84120, 133775, 214611, 343025, 551064, 883600, 1421767, 2284870, 3680296, 5924725, 9551161, 15393855, 24834827, 40061700
Offset: 1

Views

Author

Vladeta Jovovic, Sep 13 2007

Keywords

Crossrefs

Column k=2 of A235998.
Cf. A242900 (with distinct multiplicities).

Programs

  • Maple
    with(numtheory):
    a:= n-> add(add(add(binomial(j+(n-i*j)/d, j), d=select(x->xAlois P. Heinz, Feb 01 2014
  • Mathematica
    Rest@ CoefficientList[ Series[ Sum[ x^(i + j)*(x^i + x^j - 2)/((x^i - 1)*(x^j - 1)*(x^i + x^j - 1)), {i, 2, 37}, {j, i - 1}], {x, 0, 37}], x] (* Robert G. Wilson v, Sep 16 2007 *)

Formula

G.f.: Sum(Sum(x^(i+j)*(x^i+x^j-2)/((x^i-1)*(x^j-1)*(x^i+x^j-1)), j=1..i-1), i=2..infinity).
a(n) ~ 1/sqrt(5) * ((1+sqrt(5))/2)^(n+1). - Vaclav Kotesovec, May 01 2014

Extensions

More terms from Robert G. Wilson v, Sep 16 2007

A325554 Number of necklace compositions of n with distinct differences.

Original entry on oeis.org

1, 2, 2, 4, 5, 6, 11, 18, 26, 38, 60, 90, 139, 213, 329, 501, 747, 1144, 1712, 2548, 3836, 5732, 8442, 12654, 18624
Offset: 1

Views

Author

Gus Wiseman, May 11 2019

Keywords

Comments

A necklace composition of n is a finite sequence of positive integers summing to n that is lexicographically minimal among all of its cyclic rotations.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

Examples

			The a(1) = 1 through a(8) = 18 necklace compositions:
  (1)  (2)   (3)   (4)    (5)    (6)    (7)     (8)
       (11)  (12)  (13)   (14)   (15)   (16)    (17)
                   (22)   (23)   (24)   (25)    (26)
                   (112)  (113)  (33)   (34)    (35)
                          (122)  (114)  (115)   (44)
                                 (132)  (124)   (116)
                                        (133)   (125)
                                        (142)   (134)
                                        (223)   (143)
                                        (1132)  (152)
                                        (1213)  (224)
                                                (233)
                                                (1124)
                                                (1142)
                                                (1214)
                                                (1322)
                                                (11213)
                                                (11312)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Differences[#]&&neckQ[#]&]],{n,15}]

A336108 Number of compositions of 2*n with n maximal runs.

Original entry on oeis.org

1, 2, 4, 14, 36, 99, 274, 813, 2278, 6692, 19206, 56687, 164416, 486052, 1422654, 4214023, 12408476, 36825663, 108926976, 323856358, 961177042, 2862551860, 8518115200, 25407468667, 75763113682, 226297498429, 675951314988, 2021528322571, 6046881759308, 18104307275968, 54219605813884
Offset: 0

Views

Author

Gus Wiseman, Sep 04 2020

Keywords

Examples

			The a(0) = 1 through a(3) = 14 compositions:
  ()  (2)    (1,3)    (1,2,3)
      (1,1)  (3,1)    (1,3,2)
             (1,1,2)  (1,4,1)
             (2,1,1)  (2,1,3)
                      (2,3,1)
                      (3,1,2)
                      (3,2,1)
                      (1,1,3,1)
                      (1,2,2,1)
                      (1,3,1,1)
                      (2,1,1,2)
                      (1,1,1,2,1)
                      (1,1,2,1,1)
                      (1,2,1,1,1)
		

Crossrefs

A333755 has this as main diagonal n = 2*k.
A337504 is the version for anti-runs.
A337505 is the version for anti-run patterns.
A337564 is the version for patterns.
A003242 counts anti-run compositions.
A011782 counts compositions.
A106356 counts compositions by number of adjacent equal parts.
A124767 counts maximal runs in standard compositions.
A238343 counts compositions by descents.
A272919 ranks runs.
A333213 counts compositions by weak ascents.
A333769 gives run-lengths of standard compositions.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[2*n],Length[Split[#]]==n&]],{n,0,10}]
  • PARI
    a(n)={polcoef(polcoef((1 - y)/(1 - y - y*sum(d=1, 2*n, (1-y)^d*x^d/(1 - x^d) + O(x^(2*n+1)))),  2*n, x), n, y)} \\ Andrew Howroyd, Feb 02 2021

Formula

a(n) = A333755(2*n,n).
a(n) = [x^(2*n)*y^n] (1 - y)/(1 - y - y*Sum_{d>=1} (1-y)^d*x^d/(1 - x^d)). - Andrew Howroyd, Feb 02 2021

Extensions

Terms a(11) and beyond from Andrew Howroyd, Feb 02 2021

A337504 Number of compositions of 2*n with n maximal anti-runs.

Original entry on oeis.org

1, 1, 3, 8, 13, 33, 112, 286, 769, 2288, 6695, 18745, 54654, 160888, 467402, 1362378, 4016517, 11807966, 34708018, 102451390, 302870005, 895207191, 2650590597, 7859253320, 23316653154, 69231883374, 205773157904, 612021943421, 1821435719846, 5424528040529, 16165017705176
Offset: 0

Views

Author

Gus Wiseman, Sep 04 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts.

Examples

			The a(0) = 1 through a(4) = 13 compositions:
  ()  (2)  (2,2)    (2,2,2)      (2,2,2,2)
           (1,1,2)  (1,1,1,3)    (1,1,1,1,4)
           (2,1,1)  (1,1,2,2)    (1,1,2,2,2)
                    (2,2,1,1)    (2,2,2,1,1)
                    (3,1,1,1)    (4,1,1,1,1)
                    (1,1,1,2,1)  (1,1,1,1,3,1)
                    (1,1,2,1,1)  (1,1,1,2,2,1)
                    (1,2,1,1,1)  (1,1,1,3,1,1)
                                 (1,1,2,2,1,1)
                                 (1,1,3,1,1,1)
                                 (1,2,2,1,1,1)
                                 (1,3,1,1,1,1)
                                 (2,1,1,1,1,2)
		

Crossrefs

A106356 has this as main diagonal n = 2*k.
A336108 is the version for runs.
A337505 is the version for patterns.
A337564 is the version for runs in patterns.
A003242 counts anti-run compositions.
A011782 counts compositions.
A124767 counts runs in standard compositions.
A238343 counts compositions by descents.
A333213 counts compositions by weak ascents.
A333381 counts anti-runs in standard compositions.
A333382 counts adjacent unequal pairs in standard compositions.
A333489 ranks anti-runs.
A333755 counts compositions by number of runs.
A333769 gives run-lengths in standard compositions.
A337565 gives anti-run lengths in standard compositions.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[2*n],Length[Split[#,UnsameQ]]==n&]],{n,0,10}]
  • PARI
    a(n)={polcoef(polcoef(1 - y + y*(y-1)/(y - 1 - sum(d=1, 2*n, (y-1)^d*x^d/(1 - x^d) + O(x^(2*n+1)))), 2*n, x), n, y)} \\ Andrew Howroyd, Feb 02 2021

Formula

a(n) = [x^(2*n)*y^n] 1 - y + y*(y-1)/(y - 1 - Sum_{d>=1} (y-1)^d*x^d/(1 - x^d)). - Andrew Howroyd, Feb 02 2021

Extensions

Terms a(11) and beyond from Andrew Howroyd, Feb 02 2021
Showing 1-10 of 11 results. Next