OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(6) = 17: partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6], sum of largest parts is 2+2+3+4+6 = 17.
MAPLE
b:= proc(n, i) option remember; [`if`(n=i, n, 0), 0]+
`if`(i>n, [0, 0], b(n, i+1)+(l-> [l[2], l[1]])(b(n-i, i)))
end:
a:= n-> b(n, 1)[1]:
seq(a(n), n=0..50);
MATHEMATICA
Table[Total[Max[#]&/@Select[IntegerPartitions[n], OddQ[Length[#]]&]], {n, 0, 50}] (* Harvey P. Dale, Apr 19 2014 *)
b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i>n, {0, 0}, b[n, i+1] + Reverse[b[n-i, i]]]; a[n_] := b[n, 1][[1]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 06 2013
STATUS
approved