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

A336511 Total sum of the left-to-right maxima in all compositions of n.

Original entry on oeis.org

0, 1, 3, 9, 22, 52, 117, 260, 565, 1217, 2593, 5487, 11538, 24146, 50316, 104490, 216337, 446754, 920506, 1892904, 3885719, 7964162, 16300646, 33321640, 68038796, 138784403, 282824924, 575866839, 1171612786, 2381938742, 4839331484, 9825841526, 19938975797
Offset: 0

Views

Author

Alois P. Heinz, Jul 23 2020

Keywords

Examples

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

Crossrefs

Cf. A001705 (the same for permutations of [n]), A336482, A336512, A336516, A336771.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, [1, 0], add((p-> [0,
          `if`(j>m, j*p[1], 0)]+p)(b(n-j, max(m, j))), j=1..n))
        end:
    a:= n-> b(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, Max[m, j]]], {j, 1, n}]];
    a[n_] := b[n, -1][[2]];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 04 2022, after Alois P. Heinz *)

A336718 Total number of left-to-right maxima in all compositions of n into distinct parts.

Original entry on oeis.org

0, 1, 1, 4, 4, 7, 18, 21, 32, 46, 107, 121, 193, 257, 379, 728, 900, 1299, 1806, 2529, 3360, 6182, 7387, 10807, 14385, 20217, 26207, 36450, 58194, 72887, 101130, 135379, 183178, 240796, 323307, 417625, 649959, 797623, 1096645, 1426108, 1931340, 2470541
Offset: 0

Views

Author

Alois P. Heinz, Aug 01 2020

Keywords

Comments

Also total number of left-to-right minima in all compositions of n into distinct parts.

Examples

			a(6) = 18 = 3+2+2+2+1+1+2+1+2+1+1: (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
    g:= proc(n) option remember;
          `if`(n<2, n, (2*n-1)*g(n-1)-(n-1)^2*g(n-2))
        end:
    b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 b(n$2, 0):
    seq(a(n), n=0..50);
  • Mathematica
    g[n_] := g[n] = If[n < 2, n, (2 n - 1) g[n - 1] - (n - 1)^2 g[n - 2]];
    b[n_, i_, p_] := b[n, i, p] = If[i (i + 1)/2 < n, 0, If[n == 0, g[p], b[n, i - 1, p] + b[n - i, Min[n - i, i - 1], p + 1]]];
    a[n_] := b[n, n, 0];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=1..floor((sqrt(8*n+1)-1)/2)} A000254(k) * A008289(n,k).

A382312 Irregular triangle read by rows: T(n,k) is the number of compositions of n with k records.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 3, 1, 0, 5, 3, 0, 8, 8, 0, 14, 17, 1, 0, 24, 36, 4, 0, 43, 72, 13, 0, 77, 143, 36, 0, 140, 281, 90, 1, 0, 256, 550, 213, 5, 0, 472, 1073, 484, 19, 0, 874, 2093, 1068, 61, 0, 1628, 4079, 2308, 177, 0, 3045, 7950, 4912, 476, 1, 0, 5719, 15498, 10328, 1217, 6
Offset: 0

Views

Author

John Tyler Rascoe, Mar 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.

Examples

			Triangle begins:
    k=0    1    2   3  4
 n= 0 1;
 n= 1 0,   1;
 n= 2 0,   2;
 n= 3 0,   3,   1;
 n= 4 0,   5,   3;
 n= 5 0,   8,   8;
 n= 6 0,  14,  17,  1;
 n= 7 0,  24,  36,  4;
 n= 8 0,  43,  72, 13;
 n= 9 0,  77, 143, 36;
 n=10 0, 140, 281, 90, 1;
 ...
The composition (2,1,1,2,4,2,1,5,7) has 4 records.
                 ^       ^     ^ ^
T(4,1) = 5 counts: (4), (3,1), (2,2), (2,1,1), (1,1,1,1).
T(4,2) = 3 counts: (1,1,2), (1,2,1), (1,1,3).
		

Crossrefs

Cf. A002024 (row lengths), A011782 (row sums), A079500 (column k=1), A336482, A352525.

Programs

  • Maple
    b:= proc(n, m) option remember; expand(`if`(n=0, 1, add(
          b(n-j, max(m, j))*`if`(j>m, x, 1), j=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..16);  # Alois P. Heinz, Mar 28 2025
  • 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)))); vector(N, n, Vecrev(polcoeff(h, n-1)))}
    T_xy(12)

Formula

G.f.: Product_{i>0} (1 + y*x^i * (1 - x)/(1 - 2*x + x^(i+1))).
Sum_{k>0} T(n,k)*k = A336482(n).

A336484 Total number of left-to-right minima in all compositions of n.

Original entry on oeis.org

0, 1, 2, 5, 10, 22, 45, 93, 190, 387, 783, 1583, 3191, 6422, 12907, 25916, 51993, 104245, 208902, 418466, 837994, 1677694, 3358127, 6720661, 13448413, 26908246, 53834890, 107699435, 215446685, 430970500, 862065453, 1724331779, 3448987855, 6898499386
Offset: 0

Views

Author

Alois P. Heinz, Jul 22 2020

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    b:= proc(n, m, c) option remember; `if`(n=0, c, add(
          b(n-j, min(m, j), c+`if`(j b(n, 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, Min[m, j], c + If[j < m, 1, 0]], {j, 1, n}]];
    a[n_] := b[n, n+1, 0];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Mar 19 2022, after Alois P. Heinz *)

A225095 The number of new maxima over all length n sequences on {1,2,...,n}.

Original entry on oeis.org

0, 1, 5, 41, 444, 5979, 96375, 1810297, 38845520, 937702437, 25154615815, 742476758297, 23915618605956, 834831863473087, 31395048114431183, 1265451184688113105, 54426870391856267072, 2488054366709505840265, 120468464465317265258991, 6158924799179729969013985
Offset: 0

Views

Author

Geoffrey Critzer, Apr 27 2013

Keywords

Examples

			a(2) = 5 because in the length 2 sequences on {1,2}: (1',1), (1',2'), (2',1), (2',2) there are 5 new maxima indicated with '.
		

Crossrefs

Cf. A000254 (analogous sequence for permutations), A336482.

Programs

  • Maple
    b:= proc(n, i) option remember; if i<2 then [i$j=1..n]
          else b(n, i-1); add([0$t=1..j-1, add(%[h], h=1..j)+
               (j-1)^(i-1), %[t]$t=j+1..n], j=1..n) fi
        end:
    a:= n-> add(i, i=b(n, n)):
    seq(a(n), n=0..25);  # Alois P. Heinz, Apr 28 2013
  • Mathematica
    f[x_List]:=Length[Union[Rest[FoldList[Max,0,x]]]];Table[Total[Map[f,Tuples[Range[1,n],n]]],{n,1,6}]

Extensions

More terms from Alois P. Heinz, Apr 28 2013
Showing 1-5 of 5 results.