A024788 Number of 4's in all partitions of n.
0, 0, 0, 1, 1, 2, 3, 6, 8, 13, 18, 28, 38, 55, 74, 105, 139, 190, 250, 336, 436, 575, 740, 963, 1228, 1577, 1995, 2538, 3186, 4013, 5005, 6256, 7751, 9617, 11847, 14605, 17894, 21927, 26730, 32582, 39531, 47942, 57915, 69920, 84114, 101116, 121176, 145095, 173248
Offset: 1
Examples
From _Omar E. Pol_, Oct 25 2012: (Start) For n = 7 we have: -------------------------------------- . Number Partitions of 7 of 4's -------------------------------------- 7 .............................. 0 4 + 3 .......................... 1 5 + 2 .......................... 0 3 + 2 + 2 ...................... 0 6 + 1 .......................... 0 3 + 3 + 1 ...................... 0 4 + 2 + 1 ...................... 1 2 + 2 + 2 + 1 .................. 0 5 + 1 + 1 ...................... 0 3 + 2 + 1 + 1 .................. 0 4 + 1 + 1 + 1 .................. 1 2 + 2 + 1 + 1 + 1 .............. 0 3 + 1 + 1 + 1 + 1 .............. 0 2 + 1 + 1 + 1 + 1 + 1 .......... 0 1 + 1 + 1 + 1 + 1 + 1 + 1 ...... 0 ------------------------------------ . 7 - 4 = 3 The difference between the sum of the fourth column and the sum of the fifth column of the set of partitions of 7 is 7 - 4 = 3 and equals the number of 4's in all partitions of 7, so a(7) = 3. (End)
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
- G. E. Andrews and E. Deutsch, A note on a method of Erdos and the Stanley-Elder theorems, Integers, 16 (2016), A24.
- L. Babel, A. Brandstädt, and V. B. Le, Recognizing the P4-structure of bipartite graphs, Discrete Appl. Math. 93 (1999), 157-168.
- David Benson, Radha Kessar, and Markus Linckelmann, Hochschild cohomology of symmetric groups in low degrees, arXiv:2204.09970 [math.GR], 2022.
Crossrefs
Programs
-
Maple
b:= proc(n, i) option remember; local f, g; if n=0 or i=1 then [1, 0] else f:= b(n, i-1); g:= `if`(i>n, [0$2], b(n-i, i)); [f[1]+g[1], f[2]+g[2]+`if`(i=4, g[1], 0)] fi end: a:= n-> b(n, n)[2]: seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Mathematica
Table[ Count[ Flatten[ IntegerPartitions[n]], 4], {n, 1, 50} ] (* second program: *) b[n_, i_] := b[n, i] = Module[{g}, If[n == 0 || i == 1, {1, 0}, g = If[i > n, {0, 0}, b[n - i, i]]; b[n, i - 1] + g + {0, If[i == 4, g[[1]], 0]}]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 09 2015, after Alois P. Heinz *)
Formula
From Peter Bala, Dec 26 2013: (Start)
O.g.f.: x^4/(1 - x^4) * product {k >= 1} 1/(1 - x^k) = x^4 + x^5 + 2*x^6 + 3*x^7 + ....
Asymptotic result: log(a(n)) ~ 2*sqrt(Pi^2/6)*sqrt(n) as n -> inf. (End)
a(n) ~ exp(Pi*sqrt(2*n/3)) / (8*Pi*sqrt(2*n)) * (1 - 49*Pi/(24*sqrt(6*n)) + (49/48 + 1633*Pi^2/6912)/n). - Vaclav Kotesovec, Nov 05 2016
G.f.: x^4/((1 - x)*(1 - x^2)*(1 - x^3)*(1 - x^4)) * Sum_{n >= 0} x^(4*n)/( Product_{k = 1..n} 1 - x^k ); that is, convolution of A026810 (partitions into 4 parts, or, modulo offset differences, partitions into parts <= 4) and A008484 (partitions into parts >= 4). - Peter Bala, Jan 17 2021
Comments