A024786
Number of 2's in all partitions of n.
Original entry on oeis.org
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
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)
- J. Riordan, Combinatorial Identities, Wiley, 1968, p. 184.
- 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.
-
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
-
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 *)
-
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
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
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)
- 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.
-
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
-
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 *)
A024787
Number of 3's in all partitions of n.
Original entry on oeis.org
0, 0, 1, 1, 2, 4, 6, 9, 15, 21, 31, 45, 63, 87, 122, 164, 222, 298, 395, 519, 683, 885, 1146, 1475, 1887, 2401, 3050, 3845, 4837, 6060, 7563, 9402, 11664, 14405, 17751, 21807, 26715, 32634, 39784, 48352, 58649, 70969, 85690, 103232, 124143, 148951, 178407, 213277, 254509
Offset: 1
From _Omar E. Pol_, Oct 25 2012: (Start)
For n = 7 we have:
--------------------------------------
. Number
Partitions of 7 of 3's
--------------------------------------
7 .............................. 0
4 + 3 .......................... 1
5 + 2 .......................... 0
3 + 2 + 2 ...................... 1
6 + 1 .......................... 0
3 + 3 + 1 ...................... 2
4 + 2 + 1 ...................... 0
2 + 2 + 2 + 1 .................. 0
5 + 1 + 1 ...................... 0
3 + 2 + 1 + 1 .................. 1
4 + 1 + 1 + 1 .................. 0
2 + 2 + 1 + 1 + 1 .............. 0
3 + 1 + 1 + 1 + 1 .............. 1
2 + 1 + 1 + 1 + 1 + 1 .......... 0
1 + 1 + 1 + 1 + 1 + 1 + 1 ...... 0
------------------------------------
. 13 - 7 = 6
The difference between the sum of the third column and the sum of the fourth column of the set of partitions of 7 is 13 - 7 = 6 and equals the number of 3's in all partitions of 7, so a(7) = 6.
(End)
- Alois P. Heinz, Table of n, a(n) for n = 1..5000
- 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.
- Eric Weisstein's World of Mathematics, q-Pochhammer Symbol
-
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(i=3, g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Table[ Count[ Flatten[ IntegerPartitions[n]], 3], {n, 1, 50} ]
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==3, 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 *)
Join[{0, 0}, (1/((1 - x^3) QPochhammer[x]) + O[x]^50)[[3]]] (* Vladimir Reshetnikov, Nov 22 2016 *)
A024789
Number of 5's in all partitions of n.
Original entry on oeis.org
0, 0, 0, 0, 1, 1, 2, 3, 5, 8, 12, 17, 25, 35, 50, 68, 94, 126, 170, 226, 299, 391, 511, 660, 853, 1091, 1393, 1766, 2235, 2811, 3527, 4403, 5484, 6800, 8415, 10369, 12752, 15627, 19110, 23298, 28346, 34389, 41642, 50295, 60636, 72929, 87563, 104903, 125470
Offset: 1
From _Omar E. Pol_, Oct 25 2012: (Start)
For n = 8 we have:
--------------------------------------
. Number
Partitions of 8 of 5's
--------------------------------------
8 .............................. 0
4 + 4 .......................... 0
5 + 3 .......................... 1
6 + 2 .......................... 0
3 + 3 + 2 ...................... 0
4 + 2 + 2 ...................... 0
2 + 2 + 2 + 2 .................. 0
7 + 1 .......................... 0
4 + 3 + 1 ...................... 0
5 + 2 + 1 ...................... 1
3 + 2 + 2 + 1 .................. 0
6 + 1 + 1 ...................... 0
3 + 3 + 1 + 1 .................. 0
4 + 2 + 1 + 1 .................. 0
2 + 2 + 2 + 1 + 1 .............. 0
5 + 1 + 1 + 1 .................. 1
3 + 2 + 1 + 1 + 1 .............. 0
4 + 1 + 1 + 1 + 1 .............. 0
2 + 2 + 1 + 1 + 1 + 1 .......... 0
3 + 1 + 1 + 1 + 1 + 1 .......... 0
2 + 1 + 1 + 1 + 1 + 1 + 1 ...... 0
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 .. 0
------------------------------------
. 7 - 4 = 3
The difference between the sum of the fifth column and the sum of the sixth column of the set of partitions of 8 is 7 - 4 = 3 and equals the number of 5's in all partitions of 8, so a(8) = 3.
(End)
-
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(i=5, g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Table[ Count[ Flatten[ IntegerPartitions[n]], 5], {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 == 5, 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 *)
-
x='x+O('x^50); concat([0, 0, 0, 0], Vec(x^5/(1 - x^5) * prod(k=1, 50, 1/(1 - x^k)))) \\ Indranil Ghosh, Apr 06 2017
A024790
Number of 6's in all partitions of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 12, 16, 24, 33, 47, 63, 89, 117, 159, 209, 278, 360, 474, 607, 786, 1001, 1280, 1615, 2049, 2565, 3222, 4011, 4998, 6180, 7653, 9407, 11571, 14154, 17308, 21063, 25630, 31044, 37586, 45339, 54646, 65646, 78804, 94305, 112761, 134473
Offset: 1
-
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(i=6, g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Table[ Count[ Flatten[ IntegerPartitions[n]], 6], {n, 1, 52} ]
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 == 6, 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 *)
A024794
Number of 10's in all partitions of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 43, 57, 79, 104, 140, 183, 242, 312, 407, 520, 670, 849, 1081, 1359, 1715, 2141, 2678, 3322, 4125, 5085, 6274, 7691, 9430, 11502, 14025, 17024, 20655, 24959, 30140, 36270, 43612, 52274, 62604, 74763
Offset: 1
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
- David Benson, Radha Kessar, and Markus Linckelmann, Hochschild cohomology of symmetric groups in low degrees, arXiv:2204.09970 [math.GR], 2022.
- Joseph Vandehey, Digital problems in the theory of partitions, Integers (2024) Vol. 24A, Art. No. A18. See p. 3.
Cf.
A066633,
A000070(n-1),
A024786,
A024787,
A024788,
A024789,
A024790,
A024791,
A024792,
A024793,
A000041.
-
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(i=10, g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Table[ Count[ Flatten[ IntegerPartitions[n]], 10], {n, 1, 55} ]
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 == 10, 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 *)
A024792
Number of 8's in all partitions of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 15, 23, 31, 44, 59, 82, 108, 146, 191, 254, 328, 429, 549, 709, 900, 1148, 1446, 1829, 2286, 2865, 3559, 4427, 5465, 6752, 8288, 10178, 12429, 15175, 18442, 22404, 27102, 32767, 39473, 47516, 57012, 68349, 81703, 97579, 116236
Offset: 1
-
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(i=8, g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Table[ Count[ Flatten[ IntegerPartitions[n]], 8], {n, 1, 53} ]
(* 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 == 8, 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 *)
A024793
Number of 9's in all partitions of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 5, 7, 11, 15, 22, 31, 43, 58, 80, 106, 142, 187, 246, 319, 416, 533, 685, 872, 1108, 1397, 1762, 2204, 2755, 3426, 4251, 5250, 6476, 7950, 9746, 11905, 14514, 17638, 21403, 25888, 31265, 37661, 45288, 54329, 65079, 77775
Offset: 1
-
b:= proc(n, i) option remember; local g;
if n=0 or i=1 then [1, 0]
else g:= `if`(i>n, [0$2], b(n-i, i));
b(n, i-1) +g +[0, `if`(i=9, g[1], 0)]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 27 2012
-
Table[ Count[ Flatten[ IntegerPartitions[n]], 9], {n, 1, 55} ]
(* 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 == 9, 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 *)
A206557
Number of 7's in the last section of the set of partitions of n.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 2, 2, 4, 5, 7, 9, 13, 16, 23, 28, 39, 48, 64, 79, 104, 128, 165, 204, 258, 317, 399, 487, 606, 739, 912, 1105, 1356, 1637, 1994, 2400, 2906, 3485, 4199, 5016, 6015, 7164, 8553, 10151, 12076, 14286, 16930, 19974, 23588, 27749
Offset: 1
A179385
The n-th term is the sum of all the 1's generated from all the combinations of prime numbers and ones possible, that add to n, when each prime is only allowed once and any number of ones are allowed.
Original entry on oeis.org
1, 2, 4, 7, 10, 15, 20, 27, 35, 44, 55, 67, 81, 97, 115, 135, 158, 183, 212, 244, 280, 320, 364, 413, 467, 526, 591, 661, 737, 820, 909, 1007, 1112, 1226, 1349, 1481, 1624, 1778, 1943, 2121, 2311, 2515, 2734, 2968, 3219, 3486, 3771, 4075, 4399, 4744, 5112, 5502
Offset: 1
n=7 gives 11111 11, 2111 11, 311 11, 5 11, 5 2, 32 11. (Grouped in 5's) no. of 1's: 7, 5, 4, 2, 0, 2. Sum is 20, therefore a(7) = 20.
n=12 gives 11111 11111 11, 11111 11111 2, 11111 311 11, 11111 32 11, 11111 5 11, 5 2111 11, 5 311 11, 5 32 11, 7111 11, 721 11, 73 11, 73 2, 75, eleven 1, no. of 1's: 12, 10, 9, 7, 7, 5, 4, 2, 5, 3, 2, 0, 0, 1. Sum is 67, therefore a(12) = 67.
1: 1 => 1 2: 11, 2 => 2 3: 111, 21 => 4 4: 1111, 211, 22, 31 => 7 5: 11111, 2111, 311, 23 => 10 6: 11111 1, 2111 1, 311 1, 23 1, 5 1 => 15 and so on.
-
b:= proc(n,i) option remember; if n<=0 then 0 elif i=0 then n else b(n, i-1) +b(n-ithprime(i), i-1) fi end: # R. J. Mathar, Jul 14 2010
a:= n-> b(n, numtheory[pi](n)): seq(a(n), n=1..80); # Alois P. Heinz
-
fQ[lst_List] := Sort@ Flatten@ Most@ Split@ lst == Rest@ Union@ lst; f[n_] := Sum[ Count[ Select[ IntegerPartitions[n, {k}, Join[{1}, Prime@ Range@ PrimePi@n]], fQ@# &], 1, 2], {k, n}]; Array[f, 50] (* improved by Robert G. Wilson v, Jul 20 2010 *)
(* second program: *)
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i - 1] + If[Prime[i] > n, 0, b[n - Prime[i], i - 1]]]];
a[n_] := Sum[k*b[n - k, PrimePi[n - k]], {k, 1, n}];
Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
-
a(n) = my(r); r = x/(1-x)^2 + O(x^(n+1)); forprime(p=2,n,r*=1+x^p); polcoeff(r,n) \\ Max Alekseyev, Jul 14 2010
Showing 1-10 of 11 results.
Comments