A377823
Sum of the positions of maximum parts in all compositions of n.
Original entry on oeis.org
0, 1, 4, 10, 23, 50, 110, 240, 526, 1147, 2489, 5368, 11510, 24543, 52090, 110109, 231959, 487245, 1020980, 2134838, 4455582, 9283742, 19314740, 40128699, 83265342, 172564435, 357228078, 738707908, 1526004117, 3149310585, 6493394292, 13376521031, 27532616663
Offset: 0
The composition of 7, (1,2,1,1,2) has maximum parts at positions 2 and 5; so it contributes 7 to a(7) = 240.
-
A_xy(N) = {my(x='x+O('x^N), h = sum(i=1,N, y^(i*(i+1)/2)*x^i)+sum(m=2,N, sum(i=1,N, ((y^i)*x^m)*((x-x^m)/(1-x))^(i-1)*(sum(j=0,N-m-i, prod(u=1,j, (x-x^m)/(1-x)+(y^(u+i))*x^m)))))); h}
P_xy(N) = Pol(A_xy(N), {x})
A_x(N) = {my(px = deriv(P_xy(N),y), y=1); Vecrev(eval(px))}
A_x(20)
A377824
Sum of the positions of minimum parts in all compositions of n.
Original entry on oeis.org
0, 1, 4, 10, 29, 70, 181, 435, 1046, 2470, 5762, 13283, 30371, 68847, 154935, 346433, 770154, 1703152, 3748574, 8214805, 17931172, 38997819, 84531066, 182661514, 393578129, 845777569, 1813017039, 3877390908, 8274351482, 17621535902, 37456091552, 79472869966
Offset: 0
The composition of 7, (1,2,1,1,2) has minimum parts at positions 1, 3, and 4; so it contributes 8 to a(7) = 435.
-
b:= proc(n, i, p) option remember; `if`(i<1, 0,
`if`(irem(n, i)=0, (j-> (p+j)!/j!*(p+j+1)/2*j)(n/i), 0)+
add(b(n-i*j, i-1, p+j)/j!, j=0..(n-1)/i))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..31); # Alois P. Heinz, Nov 12 2024
-
b[n_, i_, p_] := b[n, i, p] = If[i < 1, 0, If[Mod[n, i] == 0, Function[j, (p + j)!/j!*(p + j + 1)/2*j][n/i], 0] + Sum[b[n - i*j, i - 1, p + j]/j!, {j, 0, (n - 1)/i}]];
a[n_] := b[n, n, 0];
Table[a[n], {n, 0, 31}] (* Jean-François Alcover, Apr 19 2025, after Alois P. Heinz *)
-
A_xy(N) = {my(x='x+O('x^N), h = sum(m=1,N, sum(i=1,N, ((y^i)*x^m)*((x^(m+1))/(1-x))^(i-1)*(sum(j=0,N-m-i, prod(u=1,j, (x^(m+1))/(1-x)+(y^(u+i))*x^m)))))); h}
P_xy(N) = Pol(A_xy(N), {x})
A_x(N) = {my(px = deriv(P_xy(N),y), y=1); Vecrev(eval(px))}
A_x(20)
Showing 1-2 of 2 results.