OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: Sum_{k>=1} x^(2*k)/(1 - x^k)^2 / Product_{j>=2} (1 - x^j). - Ilya Gutkovskiy, Mar 05 2021
EXAMPLE
For n = 7 the last section of the set of partitions of 7 looks like this:
.
. (. . . . . . 7)
. (. . . 4 . . 3)
. (. . . . 5 . 2)
. (. . 3 . 2 . 2)
. (1)
. (1)
. (1)
. (1)
. (1)
. (1)
. (1)
. (1)
. (1)
. (1)
. (1)
.
The sum of all parts = 7+4+3+5+2+3+2+2+1*11 = 39, on the other hand the total number of parts is 1+2+2+3+1*11 = 19, so a(7) = 39 - 19 = 20. Note that the number of dots in the picture is also equal to a(7) = 6+5+5+4 = 20.
MAPLE
b:= proc(n, i) option remember; local f, g;
if n=0 then [1, 0]
elif i<2 then [0, 0]
elif i>n then b(n, i-1)
else f:= b(n, i-1); g:= b(n-i, i);
[f[1]+g[1], f[2]+g[2] +g[1]*(i-1)]
fi
end:
a:= n-> b(n, n)[2]:
seq (a(n), n=1..50); # Alois P. Heinz, Feb 20 2012
MATHEMATICA
b[n_, i_] := b[n, i] = Module[{f, g}, Which[n==0, {1, 0}, i<2, {0, 0}, i>n , b[n, i-1], True, f = b[n, i-1]; g = b[n-i, i]; {f[[1]] + g[[1]], f[[2]] + g[[2]] + g[[1]]*(i-1)}]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Sep 13 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Feb 20 2012
EXTENSIONS
More terms from Alois P. Heinz, Feb 20 2012
STATUS
approved