%I #67 Apr 27 2022 17:23:55
%S 0,0,0,1,1,2,3,6,8,13,18,28,38,55,74,105,139,190,250,336,436,575,740,
%T 963,1228,1577,1995,2538,3186,4013,5005,6256,7751,9617,11847,14605,
%U 17894,21927,26730,32582,39531,47942,57915,69920,84114,101116,121176,145095,173248
%N Number of 4's in all partitions of n.
%C The sums of four successive terms give A000070. - _Omar E. Pol_, Jul 12 2012
%C a(n) is also the difference between the sum of 4th largest and the sum of 5th largest elements in all partitions of n. - _Omar E. Pol_, Oct 25 2012
%C a(n+4) is the number of n-vertex graphs that do not contain a triangle, P_4, or K_2,3 as induced subgraph. These are the K_2,3-free bipartite cographs. Bipartite cographs are graph that are disjoint unions of complete bipartite graphs [Babel et al. Corollary 2.2], and forbidding K_2,3 leaves one possible component for each size except size 4, where there are two. Thus, this number is A000041(n) + a(n) = a(n+4). - _Falk Hüffner_, Jan 11 2016
%C a(n) (n>=3) is the number of even singletons in all partitions of n-2 (by a singleton we mean a part that occurs exactly once). Example: a(7) = 3 because in the partitions [5], [4*,1], [3,2*], [3,1,1], [2,2,1], [2*,1,1,1], [1,1,1,1,1] we have 3 even singletons (marked by *). The statement of this comment can be obtained by setting k=2 in Theorem 2 of the Andrews et al. reference. - _Emeric Deutsch_, Sep 13 2016
%H Alois P. Heinz, <a href="/A024788/b024788.txt">Table of n, a(n) for n = 1..1000</a>
%H G. E. Andrews and E. Deutsch, <a href="https://www.emis.de/journals/INTEGERS/papers/q24/q24.Abstract.html">A note on a method of Erdos and the Stanley-Elder theorems</a>, Integers, 16 (2016), A24.
%H L. Babel, A. Brandstädt, and V. B. Le, <a href="http://dx.doi.org/10.1016/S0166-218X(99)00104-3">Recognizing the P4-structure of bipartite graphs</a>, Discrete Appl. Math. 93 (1999), 157-168.
%H David Benson, Radha Kessar, and Markus Linckelmann, <a href="https://arxiv.org/abs/2204.09970">Hochschild cohomology of symmetric groups in low degrees</a>, arXiv:2204.09970 [math.GR], 2022.
%F a(n) = A181187(n,4) - A181187(n,5). - _Omar E. Pol_, Oct 25 2012
%F From _Peter Bala_, Dec 26 2013: (Start)
%F a(n+4) - a(n) = A000041(n). a(n) + a(n+2) = A024786(n).
%F 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 + ....
%F Asymptotic result: log(a(n)) ~ 2*sqrt(Pi^2/6)*sqrt(n) as n -> inf. (End)
%F 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
%F 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
%e From _Omar E. Pol_, Oct 25 2012: (Start)
%e For n = 7 we have:
%e --------------------------------------
%e . Number
%e Partitions of 7 of 4's
%e --------------------------------------
%e 7 .............................. 0
%e 4 + 3 .......................... 1
%e 5 + 2 .......................... 0
%e 3 + 2 + 2 ...................... 0
%e 6 + 1 .......................... 0
%e 3 + 3 + 1 ...................... 0
%e 4 + 2 + 1 ...................... 1
%e 2 + 2 + 2 + 1 .................. 0
%e 5 + 1 + 1 ...................... 0
%e 3 + 2 + 1 + 1 .................. 0
%e 4 + 1 + 1 + 1 .................. 1
%e 2 + 2 + 1 + 1 + 1 .............. 0
%e 3 + 1 + 1 + 1 + 1 .............. 0
%e 2 + 1 + 1 + 1 + 1 + 1 .......... 0
%e 1 + 1 + 1 + 1 + 1 + 1 + 1 ...... 0
%e ------------------------------------
%e . 7 - 4 = 3
%e 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.
%e (End)
%p b:= proc(n, i) option remember; local f, g;
%p if n=0 or i=1 then [1, 0]
%p else f:= b(n, i-1); g:= `if`(i>n, [0$2], b(n-i, i));
%p [f[1]+g[1], f[2]+g[2]+`if`(i=4, g[1], 0)]
%p fi
%p end:
%p a:= n-> b(n, n)[2]:
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Oct 27 2012
%t Table[ Count[ Flatten[ IntegerPartitions[n]], 4], {n, 1, 50} ]
%t (* second program: *)
%t 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_ *)
%Y Cf. A000041, A066633, A024786, A024787, A024789, A024790, A024791, A024792, A024793, A024794.
%K nonn,easy
%O 1,6
%A _Clark Kimberling_