login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A336902
Sum of the smallest parts of all compositions of n into distinct parts.
8
0, 1, 2, 5, 6, 11, 18, 25, 32, 53, 84, 107, 156, 205, 302, 497, 618, 863, 1206, 1597, 2228, 3569, 4440, 6191, 8256, 11329, 14642, 20477, 30390, 38555, 52578, 69625, 92696, 122141, 160500, 211955, 310476, 386941, 521102, 678617, 901386, 1155383, 1529742, 1940749
OFFSET
0,3
LINKS
FORMULA
a(n) == n (mod 2).
EXAMPLE
a(6) = 18 = 1 + 1 + 1 + 1 + 1 + 1 + 2 + 2 + 1 + 1 + 6: (1)23, (1)32, 2(1)3, 23(1), 3(1)2, 32(1), (2)4, 4(2), (1)5, 5(1), (6).
MAPLE
b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n or i<1, 0,
`if`(i=n, i*p!, b(n-i, min(n-i, i-1), p+1))+b(n, i-1, p))
end:
a:= n-> b(n$2, 1):
seq(a(n), n=0..50);
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n || i < 1, 0,
If[i == n, i*p!, b[n-i, Min[n-i, i-1], p+1]] + b[n, i-1, p]];
a[n_] := b[n, n, 1];
Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 07 2020
STATUS
approved