OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(6) = 12: 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 median parts is 1+2+2+1+6 = 12.
MAPLE
with(combinat):
a:= n-> add(`if`(nops(l)::odd, l[(nops(l)+1)/2], 0), l=partition(n)):
seq(a(n), n=0..40);
MATHEMATICA
a[n_] := Sum[If[OddQ @ Length[l], l[[(Length[l]+1)/2]], 0], {l, IntegerPartitions[n]}];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 20 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 06 2013
STATUS
approved