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-3 of 3 results.

A336482 Total number of left-to-right maxima in all compositions of n.

Original entry on oeis.org

0, 1, 2, 5, 11, 24, 51, 108, 226, 471, 976, 2015, 4146, 8508, 17418, 35590, 72597, 147868, 300797, 611202, 1240690, 2516268, 5099242, 10326282, 20897848, 42267257, 85442478, 172635651, 348651294, 703836046, 1420315254, 2865122304, 5777735296, 11647641296
Offset: 0

Views

Author

Alois P. Heinz, Jul 22 2020

Keywords

Examples

			a(4) = 11: (1)111, (1)1(2), (1)(2)1, (2)11, (2)2, (1)(3), (3)1, (4).
		

Crossrefs

Cf. A000254 (the same for permutations of [n]), A225095, A336484, A336511, A336718, A382312.

Programs

  • Maple
    b:= proc(n, m, c) option remember; `if`(n=0, c, add(
          b(n-j, max(m, j), c+`if`(j>m, 1, 0)), j=1..n))
        end:
    a:= n-> b(n, -1, 0):
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, m_, c_] := b[n, m, c] = If[n == 0, c, Sum[
         b[n - j, Max[m, j], c + If[j > m, 1, 0]], {j, 1, n}]];
    a[n_] := b[n, -1, 0];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 04 2022, after Alois P. Heinz *)
  • PARI
    T_xy(max_row) = {my(N=max_row+1, x='x+O('x^N), h= prod(i=1,N, 1 + y*x^i *(1-x)/(1-2*x+x^(i+1)))); h}
    P_xy(N) = Pol(T_xy(N), {x})
    B_x(N) = {my(cx = deriv(P_xy(N), y), y=1); Vecrev(eval(cx))}
    B_x(30) \\ John Tyler Rascoe, Mar 22 2025

Formula

a(n) = Sum_{k>0} A382312(n,k)*k. - John Tyler Rascoe, Mar 22 2025

A382288 Number of records in the n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1
Offset: 0

Views

Author

John Tyler Rascoe, Mar 20 2025

Keywords

Comments

Here a record is a part of the composition that is greater than all parts before it, reading left to right. The first part of any nonempty composition is a record so a(n) >= 1 for n > 0. See A066099 for the standard order of integer compositions.
The first appearance of k occurs at n = A164894(k) for k > 0.

Examples

			The 883rd composition is (1, 2, 1, 1, 3, 1, 1) with records 1, 2, and 3; so a(883) = 3.
                          ^  ^        ^
		

Crossrefs

Programs

  • Python
    def comp(n):
        return # see A357625
    def A382288(n):
        r,c = 0,0
        for i in comp(n):
            if i > r:
                c += 1
                r = i
        return c

Formula

a(A164894(n)) = n for n > 0.

A383275 Number of compositions of n such that any part 1 can be k different colors where k is the current record having appeared in the composition.

Original entry on oeis.org

1, 1, 2, 5, 14, 42, 134, 454, 1634, 6245, 25321, 108779, 494443, 2374288, 12024257, 64100444, 358948674, 2106756217, 12931155910, 82823317389, 552400947902, 3829070637080, 27534807426150, 205066734143893, 1579309451332366, 12559941159979791, 103013928588389695
Offset: 0

Views

Author

John Tyler Rascoe, Apr 21 2025

Keywords

Comments

A record in a composition is a part that is greater than all parts before it, reading left to right. The first part of any nonempty composition is considered a record. A part 1 can be a record, iff it is the first part of a composition.

Examples

			a(3) = 5: (3), (1_a,2), (2,1_a), (2,1_b), (1_a,1_a,1_a).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1, add(
          b(n-j, max(j, m))*`if`(j=1, m, 1), j=1..n))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..26);  # Alois P. Heinz, Apr 23 2025
  • PARI
    A_x(N) = {my(x='x+O('x^N)); Vec(prod(i=1,N,1+x^i/(1-i*x+(-x^2+x^(i+1))/(1-x))))}
    A_x(30)

Formula

G.f.: Product_{i>0} 1 + x^i/(1 - i*x - (x^2 - x^(i+1))/(1-x)).
Showing 1-3 of 3 results.