A196087 Sum of all parts minus the total numbers of parts of all partitions of n.
0, 1, 3, 8, 15, 31, 51, 90, 142, 228, 341, 525, 757, 1110, 1572, 2233, 3084, 4286, 5812, 7910, 10580, 14145, 18659, 24626, 32099, 41814, 53976, 69559, 88932, 113557, 143967, 182241, 229353, 288078, 360029, 449158, 557757, 691369, 853628, 1051974
Offset: 1
Keywords
Examples
For n = 4 the five partitions of 4 are: 4, 3+1, 2+2, 2+1+1, 1+1+1+1. The sum of all parts is 4+3+1+2+2+2+1+1+1+1+1+1 = 20. The sum of all parts is also the product n*p(n) = 4*5 = 20, where p(n) = A000041(n) is the number of partitions of n. On the other hand the number of parts in all partitions of 4 is equal to 12, so a(4) = 20-12 = 8.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
Programs
-
Maple
b:= proc(n, i) option remember; local f, g; if n=0 then [1, 0] elif i<1 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<1, {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, Oct 22 2015, after Alois P. Heinz *)
-
PARI
a(n) = n*numbpart(n) - sum(m=1, n, numdiv(m)*numbpart(n-m)); \\ Michel Marcus, Oct 22 2015
Formula
a(n) ~ exp(Pi*sqrt(2*n/3))/(4*sqrt(3)) * (1 - (3 + 6*gamma + Pi^2/24 + 3*log(6*n/Pi^2))/(Pi*sqrt(6*n))), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Oct 24 2016
G.f.: Sum_{k>=1} x^(2*k)/(1 - x^k)^2 / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Mar 05 2021
a(n) = Sum_{k=1..n-1} p(n+j,j), where p(n,j) is the number of partitions of j having exactly j parts. E.g., a(4) = p(5,1) + p(6,2) + p(7,3) = 1+3+4 = 8. - Gregory L. Simay, Aug 19 2022
Comments