A309535 Total number of square parts in all compositions of n.
0, 1, 2, 5, 13, 30, 69, 156, 348, 769, 1682, 3653, 7884, 16924, 36160, 76944, 163137, 344770, 726533, 1527052, 3202076, 6700096, 13992080, 29167936, 60703424, 126141953, 261754114, 542448645, 1122778124, 2321317916, 4794159168, 9891365008, 20388823360
Offset: 0
Keywords
Examples
a(4) = 13: (1)(1)(1)(1), (1)(1)2, (1)2(1), 2(1)(1), 22, (1)3, 3(1), (4).
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..3313
Programs
-
Maple
a:= proc(n) option remember; add(a(n-j)+ `if`(issqr(j), ceil(2^(n-j-1)), 0), j=1..n) end: seq(a(n), n=0..33);
-
Mathematica
CoefficientList[Series[(EllipticTheta[3, 0, x]-1)*(1-x)^2/(2*(1-2*x)^2), {x, 0, 30}], x] (* Vaclav Kotesovec, Aug 18 2019 *) Table[Sum[If[k == n, 1, (2^(n - k - 2)*(3 + n - k))] * If[IntegerQ[Sqrt[k]], 1, 0], {k, 1, n}], {n, 0, 30}] (* Vaclav Kotesovec, Aug 18 2019 *)
Formula
G.f.: Sum_{k>=1} x^(k^2)*(1-x)^2/(1-2*x)^2.
a(n) ~ c * 2^n * n, where c = (EllipticTheta[3, 0, 1/2] - 1)/8 = 0.1411171034014846448336823185681189155765645674... - Vaclav Kotesovec, Aug 18 2019, updated Mar 17 2024