OFFSET
0,4
COMMENTS
The first element of each partition is given weight 0.
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 0..5000 (terms 0..1000 from Alois P. Heinz)
FORMULA
a(n) ~ exp(Pi*sqrt(2*n/3)) * n / (5*sqrt(3)). - Vaclav Kotesovec, May 30 2021
EXAMPLE
a(3) = 6 because the second moments of all partitions of 3 are {3}.{0},{2,1}.{0,1} and {1,1,1}.{0,1,4}, resulting in 0,1,5; summing to 6.
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0, [1, 0],
`if`(i<1, [0$2], `if`(i>n, b(n, i-1, t), b(n, i-1, t)+
(h-> h+[0, h[1]*i*t^2])(b(n-i, i, t+1)))))
end:
a:= n-> b(n$2, 0)[2]:
seq(a(n), n=0..50); # Alois P. Heinz, Jan 29 2014
MATHEMATICA
Table[ Plus@@Map[ #.Range[ 0, -1+Length[ # ] ]^2&, IntegerPartitions[ n ] ], {n, 30} ]
(* Second program: *)
b[n_, i_, t_] := b[n, i, t] = If[n == 0, {1, 0},
If[i < 1, {0, 0}, If[i > n, b[n, i - 1, t], b[n, i - 1, t] +
Function[h, h + {0, h[[1]]*i*t^2}][b[n - i, i, t + 1]]]]];
a[n_] := b[n, n, 0][[2]];
a /@ Range[0, 50] (* Jean-François Alcover, May 30 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Wouter Meeussen, Dec 15 2001
STATUS
approved