login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A296010 Sum of the squares of the number of parts in all partitions of n. 2
0, 1, 5, 14, 34, 68, 133, 232, 402, 652, 1048, 1609, 2465, 3640, 5358, 7694, 10993, 15399, 21498, 29520, 40394, 54572, 73425, 97756, 129710, 170525, 223428, 290552, 376551, 484819, 622317, 794167, 1010515, 1279376, 1615126, 2029948, 2544600, 3176856, 3956277 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..10000 (terms 0..115 from Robert G. Wilson v)
FORMULA
G.f.: Sum_{j>=1} j^2*x^j / Product_{i=1..j} (1-x^i). - Alois P. Heinz, Dec 02 2017
EXAMPLE
For n=4, the 5 partitions of 4 are 4, 3+1, 2+2, 2+1+1, and 1+1+1+1. These have 1, 2, 2, 3, and 4 parts, respectively. The sum of the squares is 1+4+4+9+16=34.
MAPLE
K:=[]:
for n from 0 to 20 do
co:=0:
for L in combinat[partition](n) do
co:=co+nops(L)^2:
od:
K:=[op(K), co]:
od:
K;
# second Maple program:
b:= proc(n, i, c) option remember; `if`(n=0 or i=1,
(n+c)^2, `if`(i>n, 0, b(n-i, i, c+1))+b(n, i-1, c))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..50); # Alois P. Heinz, Dec 02 2017
MATHEMATICA
f[n_] := Sum[i^2 (Length@ IntegerPartitions[n, {i}]), {i, n}]; Array[f, 34, 0] (* Robert G. Wilson v, Dec 02 2017 *)
b[n_, i_, c_] := b[n, i, c] = If[n == 0 || i == 1,
(n + c)^2, If[i > n, 0, b[n - i, i, c + 1]] + b[n, i - 1, c]];
a[n_] := b[n, n, 0];
a /@ Range[0, 50] (* Jean-François Alcover, Jun 06 2021, after Alois P. Heinz *)
PROG
(PARI) first(n)=my(x='x+O('x^(n+1)), pr=1); concat(0, Vec(sum(j=1, n, pr*=1-x^j; j^2*x^j/pr))) \\ Charles R Greathouse IV, Dec 02 2017
CROSSREFS
Sequence in context: A188589 A105082 A059821 * A182738 A192957 A094584
KEYWORD
nonn
AUTHOR
Matthew C. Russell, Dec 02 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 14:32 EDT 2024. Contains 371960 sequences. (Running on oeis4.)