A024786 Number of 2's in all partitions of n.
0, 1, 1, 3, 4, 8, 11, 19, 26, 41, 56, 83, 112, 160, 213, 295, 389, 526, 686, 911, 1176, 1538, 1968, 2540, 3223, 4115, 5181, 6551, 8191, 10269, 12756, 15873, 19598, 24222, 29741, 36532, 44624, 54509, 66261, 80524, 97446, 117862, 142029, 171036, 205290, 246211
Offset: 1
Keywords
Examples
From _Omar E. Pol_, Oct 25 2012: (Start) For n = 7 we have: -------------------------------------- . Number Partitions of 7 of 2's -------------------------------------- 7 .............................. 0 4 + 3 .......................... 0 5 + 2 .......................... 1 3 + 2 + 2 ...................... 2 6 + 1 .......................... 0 3 + 3 + 1 ...................... 0 4 + 2 + 1 ...................... 1 2 + 2 + 2 + 1 .................. 3 5 + 1 + 1 ...................... 0 3 + 2 + 1 + 1 .................. 1 4 + 1 + 1 + 1 .................. 0 2 + 2 + 1 + 1 + 1 .............. 2 3 + 1 + 1 + 1 + 1 .............. 0 2 + 1 + 1 + 1 + 1 + 1 .......... 1 1 + 1 + 1 + 1 + 1 + 1 + 1 ...... 0 ------------------------------------ . 24 - 13 = 11 . The difference between the sum of the second column and the sum of the third column of the set of partitions of 7 is 24 - 13 = 11 and equals the number of 2's in all partitions of 7, so a(7) = 11. (End)
References
- J. Riordan, Combinatorial Identities, Wiley, 1968, p. 184.
Links
- Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Alois P. Heinz)
- David Benson, Radha Kessar, and Markus Linckelmann, Hochschild cohomology of symmetric groups in low degrees, arXiv:2204.09970 [math.GR], 2022.
- Philip Cuthbertson, Fixed hooks in arbitrary columns of partitions, Integers (2025) Vol. 25, Art. No. A28. See p. 3.
- Manosij Ghosh Dastidar and Sourav Sen Gupta, Generalization of a few results in Integer Partitions, arXiv preprint arXiv:1111.0094 [cs.DM], 2011.
- Emeric Deutsch et al., Problem 11237, Amer. Math. Monthly, 115 (No. 7, 2008), 666-667. [From _Emeric Deutsch_, Aug 13 2008]
- Hung Phuc Hoang and Torsten Mütze, Combinatorial generation via permutation languages. II. Lattice congruences, arXiv:1911.12078 [math.CO], 2019.
- Joseph Vandehey, Digital problems in the theory of partitions, Integers (2024) Vol. 24A, Art. No. A18. See p. 3.
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=2, g[1], 0)] fi end: a:= n-> b(n, n)[2]: seq(a(n), n=1..50); # Alois P. Heinz, May 18 2012
-
Mathematica
Table[ Count[ Flatten[ IntegerPartitions[n]], 2], {n, 1, 50} ] (* Second program: *) b[n_, i_] := b[n, i] = Module[{f, g}, If[n==0 || i==1, {1, 0}, f = b[n, i - 1]; g = If[i>n, {0, 0}, b[n-i, i]]; {f[[1]] + g[[1]], f[[2]] + g[[2]] + If[i == 2, g[[1]], 0]}]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Sep 22 2015, after Alois P. Heinz *) Join[{0}, (1/((1 - x^2) QPochhammer[x]) + O[x]^50)[[3]]] (* Vladimir Reshetnikov, Nov 22 2016 *) Table[Sum[(1 + (-1)^k)/2 * PartitionsP[n-k], {k, 2, n}], {n, 1, 50}] (* Vaclav Kotesovec, Aug 27 2017 *)
-
Python
from sympy import npartitions def A024786(n): return sum(npartitions(n-(k<<1)) for k in range(1,(n>>1)+1)) # Chai Wah Wu, Oct 25 2023
Formula
a(n) = Sum_{k=1..floor(n/2)} A000041(n-2k). - Christian G. Bower, Jun 22 2000
a(n) = Sum_{kA000041, P(0) = 1. - Jose Luis Arregui (arregui(AT)posta.unizar.es), Apr 05 2002
G.f.: (x^2/((1-x)*(1-x^2)^2))*Product_{j>=3} 1/(1-x^j) from Riordan reference second term, last eq.
a(n) ~ exp(Pi*sqrt(2*n/3)) / (2^(5/2) * Pi * sqrt(n)) * (1 - 25*Pi/(24*sqrt(6*n)) + (25/48 + 433*Pi^2/6912)/n). - Vaclav Kotesovec, Mar 07 2016, extended Nov 05 2016
a(n) = Sum_{k} k * A116595(n-1,k). - Emeric Deutsch, Sep 12 2016
G.f.: x^2/((1 - x)*(1 - x^2)) * Sum_{n >= 0} x^(2*n)/( Product_{k = 1..n} 1 - x^k ); that is, convolution of A004526 (partitions into 2 parts, or, modulo offset differences, partitions into parts <= 2) and A002865 (partitions into parts >= 2). - Peter Bala, Jan 17 2021
Comments