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
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).
-
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);
-
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
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).
-
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);
-
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 *)
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
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).
-
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
-
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)
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
a(4) = 10: (1)111, (1)12, (1)21, (2)(1)1, (2)2, (1)3, (3)(1), (4).
-
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);
-
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
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 '.
-
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
-
f[x_List]:=Length[Union[Rest[FoldList[Max,0,x]]]];Table[Total[Map[f,Tuples[Range[1,n],n]]],{n,1,6}]
Showing 1-5 of 5 results.
Comments