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”).

Sum of the largest parts of all compositions of n into distinct parts.
8

%I #15 Jul 12 2021 04:16:47

%S 0,1,2,7,10,19,42,61,98,151,304,403,654,925,1400,2431,3328,4903,7056,

%T 10117,13952,23419,30406,44683,61308,87289,116822,164359,247774,

%U 327715,457542,624445,855062,1148023,1559188,2058643,3043506,3906637,5375732,7111975,9679852

%N Sum of the largest parts of all compositions of n into distinct parts.

%H Alois P. Heinz, <a href="/A336903/b336903.txt">Table of n, a(n) for n = 0..5000</a>

%F a(n) == n (mod 2).

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

%p b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0,

%p `if`(n=0, p!, b(n-i, min(n-i, i-1), p+1)*

%p `if`(p=0, i, 1)+b(n, i-1, p)))

%p end:

%p a:= n-> `if`(n=0, 0, b(n$2, 0)):

%p seq(a(n), n=0..50);

%t b[n_, i_, p_] := b[n, i, p] = If[i(i + 1)/2 < n, 0,

%t If[n == 0, p!, b[n - i, Min[n - i, i - 1], p + 1]*

%t If[p == 0, i, 1] + b[n, i - 1, p]]];

%t a[n_] := If[n == 0, 0, b[n, n, 0]];

%t Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Jul 12 2021, after _Alois P. Heinz_ *)

%Y Cf. A005895, A006128, A046746, A092265, A097939, A102712, A336902.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Aug 07 2020