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-4 of 4 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

A336512 Total sum of the left-to-right minima in all compositions of n.

Original entry on oeis.org

0, 1, 3, 8, 17, 38, 78, 162, 330, 672, 1355, 2736, 5503, 11058, 22191, 44507, 89198, 178697, 357852, 716440, 1434041, 2869935, 5742801, 11490298, 22988084, 45988166, 91995547, 184021931, 368093352, 736266262, 1472660452, 2945526806, 5891385159, 11783304479
Offset: 0

Views

Author

Alois P. Heinz, Jul 23 2020

Keywords

Examples

			a(4) = 1 + 1 + 1 + 2 + 1 + 2 + 1 + 3 + 1 + 4 = 17: (1)111, (1)12, (1)21, (2)(1)1, (2)2, (1)3, (3)(1), (4).
		

Crossrefs

Cf. A001563 (the same for permutations of [n]), A336484, A336511, A336516, A336770.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, [1, 0], add((p-> [0,
          `if`(j b(n, n+1)[2]:
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[Function[p, {0,
         If[j < m, j*p[[1]], 0]} + p][b[n - j, Min[m, j]]], {j, 1, n}]];
    a[n_] := b[n, n + 1][[2]];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 07 2022, after Alois P. Heinz *)

A336516 Sum of parts, counted without multiplicity, in all compositions of n.

Original entry on oeis.org

0, 1, 3, 10, 24, 59, 136, 309, 682, 1493, 3223, 6904, 14675, 31013, 65202, 136512, 284748, 592082, 1227709, 2539516, 5241640, 10798133, 22206568, 45597489, 93495667, 191464970, 391636718, 800233551, 1633530732, 3331568080, 6789078236, 13824212219, 28129459098
Offset: 0

Views

Author

Alois P. Heinz, Jul 24 2020

Keywords

Examples

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

Crossrefs

Cf. A001787 (all parts), A014153 (the same for partitions), A336511, A336512, A336579, A336875.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, [p!, 0],
          `if`(i<1, 0, add((p-> [0, `if`(j=0, 0, p[1]*i)]+p)(
             b(n-i*j, i-1, p+j)/j!), j=0..n/i)))
        end:
    a:= n-> b(n$2, 0)[2]:
    seq(a(n), n=0..38);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n == 0, {p!, 0},
         If[i < 1, {0, 0}, Sum[Function[{0, If[j == 0, 0, #[[1]]*i]} + #][
           b[n - i*j, i - 1, p + j]/j!], {j, 0, n/i}]]];
    a[n_] := b[n, n, 0][[2]];
    Table[a[n], {n, 0, 38}] (* Jean-François Alcover, Mar 11 2022, after Alois P. Heinz *)

A336771 Total sum of the left-to-right maxima in all compositions of n into distinct parts.

Original entry on oeis.org

0, 1, 2, 8, 11, 22, 53, 75, 123, 193, 418, 538, 894, 1268, 1950, 3567, 4799, 7143, 10355, 14968, 20701, 36398, 46420, 69071, 94972, 136385, 182522, 259104, 402405, 527090, 741569, 1015491, 1397661, 1880541, 2567202, 3392612, 5153156, 6553844, 9088372, 12040797
Offset: 0

Views

Author

Alois P. Heinz, Aug 04 2020

Keywords

Examples

			a(6) = 53 = 6+4+5+5+3+3+6+4+6+5+6: (1)(2)(3), (1)(3)2, (2)1(3), (2)(3)1, (3)12, (3)21, (2)(4), (4)2, (1)(5), (5)1, (6).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, k, m) option remember; `if`(i
          (2*i-k+1)*k/2, 0, `if`(n=0, [1, 0], b(n, i-1, k, m)+
          (p-> p+[0, p[1]*i/(m+1-k)])(b(n-i, min(n-i, i-1), k-1, m))))
        end:
    a:= n-> add(b(n$2, k$2)[2]*k!, k=1..floor((sqrt(8*n+1)-1)/2)):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, i_, k_, m_] := b[n, i, k, m] = If[i < k || n >
        (2*i - k + 1)*k/2, {0, 0}, If[n == 0, {1, 0}, b[n, i - 1, k, m] +
        Function[p, p+{0, p[[1]]*i/(m+1-k)}][b[n-i, Min[n-i, i-1], k-1, m]]]];
    a[n_] := Sum[b[n, n, k, k][[2]]*k!, {k, 1, Floor[(Sqrt[8*n + 1] - 1)/2]}];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)
Showing 1-4 of 4 results.