cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A024788 Number of 4's in all partitions of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The sums of four successive terms give A000070. - Omar E. Pol, Jul 12 2012
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
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
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

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)
		

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

a(n) = A181187(n,4) - A181187(n,5). - Omar E. Pol, Oct 25 2012
From Peter Bala, Dec 26 2013: (Start)
a(n+4) - a(n) = A000041(n). a(n) + a(n+2) = A024786(n).
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